Hi,
I'm trying to connect an ESC to this drone's board, however, it only accepts brushed motors. I want to know if it's possible to use the Arduino to convert the signal from the mosfets to the signal that the ESC accepts. I created this code below but it didn't work correctly
#include <Servo.h>
#define ESC_PIN 9
Servo esc;
void setup()
{
esc.attach(ESC_PIN, 1000, 2000);
esc.write(0);
delay(2000);
pinMode(A0, INPUT);
}
void loop()
{
int pwmValue = pulseIn(A0, HIGH);
pwmValue = constrain(pwmValue, 0, 255);
int motorSpeed = map(pwmValue, 0, 255, 0, 180);
esc.write(motorSpeed);
}