Hi guys,
I am from Bulgaria and just bought arduino adk.I want to controll an esc(brushed).I found a source for a servo and tested it on my esc and it works but my problem is that it starts, rotate a little then stops for a second or two and then rotate a little again. I want to change it so i can select speed and rotate it without breaks ,but dont uderstand the source enough to do it.So my request is to explain it to me please.My ESC is sp-03018. Here is the source:
int servoPin = 2;
int myAngle;
int pulseWidth;
void setup ()
{
pinMode (servoPin, OUTPUT);
}
void servoPulse (int servoPin, int myAngle)
{
pulseWidth = (myAngle* 10) + 600;
digitalWrite (servoPin, HIGH);
delayMicroseconds (pulseWidth);
digitalWrite (servoPin, LOW);
}
void loop ()
{
for(myAngle = 10;myAngle <= 170; myAngle++)
{
servoPulse (servoPin, myAngle);
delay (20);
}
for (myAngle = 170; myAngle>= 10;myAngle--)
{
servoPulse (servoPin, myAngle);
delay (20);
}
}
PS.I am sorry for my bad english.
Because I heard that this libraly can controll only 2 at once, am planning to controll 4 escs
EDIT:I saw now that it can controll up to 12 thx i'll try it.
It may be earlier versions only supported 2 servos, but from what I've read, an Arduino would have trouble controlling more than 2 servos if the Arduino has to power the servo (it may even have problems powering one servo depending on what else you are using). If you are going to power 4 servos, I would expect you would need the servos on a separate power circuit -- you need to wire the ground of the two power supplies together.