Arduino Boe Bot Kit problem with reverse
Hi all, I am new to robotics, and I am having a slight issue with Boe Bot Kit/Arduino. I have "centered the servos" and have no issue getting the bot to move forward. (but) I cannot get the Bot to go backwards only the right servo goes in reverse while the left stays still.
Forward Sketch http://learn.parallax.com/node/220
the reverse sketch is the same as above except swtiching
// Full speed reverse servo
Left.writeMicroseconds(1300); // Left wheel clockwise servo
Right.writeMicroseconds(1700); // Right wheel counterclockwise
delay(10000); // ...for 10 secondsAny advice will be appreciated!
Forward Sketch http://learn.parallax.com/node/220
the reverse sketch is the same as above except swtiching
// Full speed reverse servo
Left.writeMicroseconds(1300); // Left wheel clockwise servo
Right.writeMicroseconds(1700); // Right wheel counterclockwise
delay(10000); // ...for 10 secondsAny advice will be appreciated!
Comments
Keep in mind that the servos need to see the pulse repeated about every 20ms or they'll stop. Your little program fragment sends just one pulse. If you want the servos to continue moving, you need to put the .writeMicroseconds call into a loop with a 20ms pause also in the loop. The number of times in the loop defines how long the servos will move. 50 times through a for statement will come to about one second.
Use the full ForwardLeftRightBackward example on this page for your test:
http://learn.parallax.com/node/219
Mike's response, while well intended, is not applicable to the Arduino. You're already using the Arduino Servo library, which does all the pulse timing. He's referring to when using a controller like the BASIC Stamp.
-- Gordon
EDIT Sketch titled "Robotics with the BOE Shield - ForwardLeftRightBackward"