Hi,
I am trying to control my servo.
I have an Arduino Diecimila board, the servo is called SERVO POWER HD 6001HB (bought here http://www.bricogeek.com/shop/motores/251-servo-power-hd-6001hb.html).
I have attached the red cable to the 5V, the brown cable to the ground and the yellow cable to pin 3.
Now if I run the example code, the Sweep sketch, it works, the servo slowly turns 180 degrees and back.
But if I try to run such a simple sketch:
#include <Servo.h>
Servo servo1;
void setup()
{
servo1.attach(3);
servo1.write(0);
delay(5000);
servo1.write(30);
delay(5000);
servo1.write(70);
servo1.detach();
}
void loop()
{ }
it doesn’t work. Sometimes it does not move, some others it moves just once, some others it moves a bunch of times like in a random way.
I have tried to check the sequence of commands by adding some Serial.println() and I have seen strange things, the delays are not respected (while in other situations they work) and the lines sometimes are printed in a strange order .
Any idea?
thanks…