1
SKILL
LEVEL
Ringo Educational Guide Rev04.1 ~ Plum Geek
Using Ringo’s Motors
Now lets make Ringo move backward. Backward movement works the same way
as forward movement, you just give Ringo negative movement numbers. Try this
example:
This example is exactly the same as the
previous example, except that we’ve told Ringo
to move the motors in the negative direction
by placing minus signs in front of the speed
numbers. The command
Motors(-200,-200);
does this for us.
Have a guess at how we could make Ringo
turn? We can set one motor to move forward
and the other motor to move backward. Try
using this command to set motor speed:
Motors(200, -200);
What happens? This
is causing the left motor to move at speed
200 in the forward direction, and the right
motor to move at speed 200 in the backward
direction (the minus sign makes the motor
move backward).
What if we reverse these numbers? Try
using this command to set motor speed:
Motors(-200, 200);
We now set the left
motor to negative speed and the right to
positive speed. This should cause Ringo to
spin in the opposite direction.
void loop(){
Motors(-200, -200);
// set left and right motors to NEGATIVE 200 speed
delay(1000);
// wait 1 second
Motors(0, 0);
// make both motors stop
delay(3000);
// wait 3 seconds
}
Backward Movement
Turning Movement