1
SKILL
LEVEL
Ringo Educational Guide Rev04.1 ~ Plum Geek
Using Ringo’s Motors
Ringo is fitted with a pair of small motors. These allow him to move
around. The ends of the motors reach down and touch the surface
he is sitting on. We can make him move forward, backward, or turn
depending on how we control these motors.
Controlling the motors from your code is really easy. Let’s jump right
into an example then we’ll talk about it.
Ringo is not an all-terrain robot, so he does require a smooth surface to move
properly. Desktops, counter tops, and smooth flooring are ideal surfaces.
Be careful Ringo doesn’t jump off your table. He does have sensors to see the
edges of tables, but he won’t respond to them unless your code specifically
tells him to do so. We’ll get to that eventually, but these simple examples do not
automatically look for edges.
If Ringo’s motors are forced to stop, they will not be damaged due to over-
current, but it’s still good practice to allow the motors to spin freely without
forcing them to stop.
The
Motors();
function accepts two numbers as arguments: one for left motor
speed, and one for right motor speed. The values can range from -255 to positive
255 for each. When this line of code is executed, Ringo’s motors will immediately
start running at the commanded speed.
Let’s see how this works with an example on the next page, but first, let’s consider
a few important notes.
void loop(){
Motors(LEFT, RIGHT);
//this function makes the motors go!
}