Motors didn't rotate when I burnt my own code to controller board


#1

Hello. I came up with a strange issue yesterday.
First, gave the PWM signal to ESC from an outside Arduino uno
I unplugged the PWM signal wire of ESC from the controller board (other wires were still connected on the board) and connected it to my own arduino uno and powered up the ROV by connecting the topside box to laptop, and the motor successfuly rotate.
Second, burnt the code to the controller board by using IDE and the PWM signal was given by the controller board. It turned out that the motor didn’t rotate. It’s very wired.
I am not so familiar with using ESC but this phenomenon really freaked me out:sweat:
I doubted may be in the first issues, some code in the controller board had “helped” the ESC while in the second issue ,the “helper” disappeard…
My code:
#include <Servo.h>

Servo esc1,esc2,esc3;

void setup()
{
Serial.begin(9600);
esc1.attach(15);
esc2.attach(16);
esc3.attach(17);

}

void loop()
{
//int throttle = analogRead(throttlePin);
int throttle = 0;
int value = 0;
for (throttle = 0; throttle <= 1023; throttle++)
{
value = map(throttle, 0, 1023, 0, 179);
esc1.write(value);
esc2.write(value);
esc3.write(value);

//Serial.println(value);
delay(10);
}

for (throttle = 1023; throttle >= 0; throttle—)
{
value = map(throttle, 0, 1023, 0, 179);
esc1.write(value);
esc2.write(value);
esc3.write(value);

//Serial.println(value);
//delay(10);
}
}