Hi there.
I'm building an RC plane with 2x brushless motors and 2x 20A ESC's, and I'm using custom tx/rx that I made myself with Arduino. The ESC's have 4 wires: 1x VCC and 1x Ground connected to the battery, 1x signal wire and 1x Ground connected to the Arduino. It's my first time building a plane, so any help would be greatly appreciated.
The problem is, when starting up the plane, the ESC's make regular beeps. When I change the throttle input (an analogWrite value in the 128-255 range), the beeping stops for a few seconds, then continues like before. I've tried like everything with the controls and still can't calibrate the ESC's.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Servo.h>
Servo pitch;
Servo roll;
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
struct flightdata{
int pitch;
int roll;
int esc1;
int esc2;
};
void setup() {
pitch.attach(3);
roll.attach(9);
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
flightdata controls;
radio.read(&controls, sizeof(controls));
pitch.write(controls.pitch);
roll.write(controls.roll);
analogWrite(5, controls.esc1);
analogWrite(6, controls.esc2);
}
}