Arduino uno shield bot servo rotates ~ 20 degrees on power up then works correctly
gscermak
Posts: 6
Hi,
One of the servos on my uno shield bot rotates ~ 20 degrees on power up then works correctly. I recentered the servo several times. The other servo behave just fine. OIdeas?
Thanks,
Greg
One of the servos on my uno shield bot rotates ~ 20 degrees on power up then works correctly. I recentered the servo several times. The other servo behave just fine. OIdeas?
Thanks,
Greg
Comments
Can you post your code so it can be reviewed?
#include <Servo.h>
Servo servoLeft;
//Servo servoRight;
void setup()
{
servoLeft.attach(13);
//servoRight.attach(12);
// Clockwise
servoLeft.writeMicroseconds(1300);
//servoRight.writeMicroseconds(1300);
delay(3000);
// Still
servoLeft.writeMicroseconds(1500);
//servoRight.writeMicroseconds(1500);
delay(1000);
// Counter clockwise
servoLeft.writeMicroseconds(1700);
//servoRight.writeMicroseconds(1700);
delay(3000);
// Counter clockwise
servoLeft.writeMicroseconds(1500);
//servoRight.writeMicroseconds(1500);
}
void loop()
{
}
Thanks,
Greg
Say you always center them in your code, before powering down your project. And then try a powercycle- do they stay almost still at the next power up?
If I recall correctly, some of the Arduino pins toggle and this is interpreted by the servo as a signal. Specifically, the Arduino has a built-in LED on P13 that toggles on startup.
Will be interested in the results.
Ken Gracey
I’ve never had any issues with the servos (Parallax CR servos).
* sketch_left_servo_test */
#include <Servo.h>
Servo servoLeft;
//Servo servoRight;
void setup()
There is no server port 14 and 15 on the BOA Shield, only 12 and 13.
Greg
Never mind the reference to DHB-10; I realize you're using the Shield-Bot for Arduino.
Ken Gracey
Thanks,
Greg
Also, there's another problem that can be introduced by building circuits on the breadboard and using any of the servo pins. Do you have any circuits on P 10/11 - on the breadboard - when you are trying to drive servos?
Can you post a picture of your robot, up close?
Ken Gracey
I did try P 10/11, but there appears to be no power at those ports. I don't have a voltmeter to check at the moment but will next week when I return home. Is there a jumper I need to move?
Thanks and best,
Greg
Is the Power Switch in position 2 ,(board and servos)?