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.
