Hi, I have this ESC: Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking
and I am trying to run a brushless motor with it through an Arduino.
Using this code I am able to get it to run but I cannot get the motor to run continuously. It always starts up and then stops. I am pretty sure this is a problem with how I am programming the ESC, but I am not sure what I am doing wrong. Here is the data sheet for the ESC: Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking
and here is the code
void setup()
{
myservo.attach(9);
}
void loop()
{
int val = myservo.read();
if(val != 80)
{
for(pos = 0; pos < 80; pos += 5)
{
myservo.write(pos);
delay(100);
}
}
else
{
delay(100);
myservo.write(val);
}
}
I am not really sure how ESC code is supposed to work, so I'm not sure if I should be rewriting the value of the ESC every time or not. It seems as if the code always goes through the first if statement as the motor runs for a little bit, stops, then runs for a little bit, stops, etc.
Also, just in case this matters, I am using this motor:Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking
and this Lipo:http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=9272
Any help I could get would be greatly appreciated.
Thanks