I am trying to control a brushless motor with WeMOS D1 ESP8266
The motor controller and motor specs are below:
https://www.ebay.com/itm/114619313561
A 11.1v LiPo battery powers both the controller and ESP8266 (VIN, GND, D9-GPIO2)
Turning on the controller spins its fan. but the motor does not spin nor does it beep.
What is the arming procedure to get the beeps to get the motor started?
Also, the ESC has a built-in switch. Should this be turned on at the time Setup() is run? If the switch is turned on, ESC fan immediately starts spinning.
Coded as per this:
UPDATE
I was able to arm it ! Well partially. Need to arm and use it without resetting Arduino in-between.
Uploaded above code to Arduino
Turned on the ESC switch. Fan started spinning.
Reset Arduino
Around i=76 in setup() heard 3 beeps and then nothing happened
Reset Arduino again
Around i=76 heard 1 beep in setup()
loop() got executed and motor started spinning wildly that battery got disconnected.
Questions:
How do I make sure 3 beeps and then the 1 beep happen without Arduino reset in between?
What does variable i mean in the code above? Speed or angle or throttle or frequency or PWM ?
How do I gradually accelerate the motor?
Where can I get something to clamp down the motor? Home depot?
Tested code:
#include <Servo.h>
Servo motor;
void setup ()
{
motor.attach(2);
Serial.begin(9600);
int i = 0;
//Give some time before you start anything like switching on your ESC / Motor
Serial.print("Arming Test Starts in ");
for(i =10; i > 0; i--)
{
Serial.print(i);
Serial.print(".. ");
}
// delay(1000);
Serial.println();
// Watch for the tone when the ESC gets armed
for(i = 60; i < 80; i++)
{
motor.write(i);
Serial.println(i);
delay(500);
}
}
void loop()
{
motor.write(80); delay(1000);
motor.write(91); delay(2000);
}