I have bought 2 Brushless motor with 1 esc each, however when I use the servo library to send the ppm signal to the esc independently, only one of the two turns and the other beeps continuously every 2 sec...
I've connected the first ESC to pin 4 the second to pin 5 (only pin 4 successfully launches the Brushless motor)
My arduino uno communicates directly with the ESCs (which are powered with 11V)
The test code I have adapted is as follows:
#include <Servo.h>
Servo motA;
Servo motB;
char data;
/**
*
* Initialisation routine
*/
void setup() {
Serial.begin(9600);
while (!Serial);
motA.attach(4);//Arming the ESCs
motB.attach(5);
delay(20);
delay(1000)
motA.write(180);
motB.write(180);
delay(1000);
motA.write(0);
motB.write(0);
displayInstructions();
}
/**
* Main function
*/
void loop() {
if (Serial.available()) {
data = Serial.read();
switch (data) {
// 0
case 48 : Serial.println("Sending 0 throttle");
motA.write(0);
motB.write(0);
break;
// 1
case 49 : Serial.println("Sending 180 throttle");
motA.write(100);
motB.write(100);
break;
// 2
case 50 : Serial.print("Running test in 3");
delay(1000);
Serial.print(" 2");
delay(1000);
Serial.println(" 1...");
delay(1000);
test();
break;
}
}
}
/**
* Test function sending angle to the ESCs from 0 to 180 degrees
*/
void test()
{
for (int i=0; i<=180; i++) {
Serial.print("Speed = ");
Serial.println(i);
motA.write(i);
motB.write(i);
delay(20);
///motB.write(i);
if (Serial.available()) {
data = Serial.read();
}
delay(1000);
}
Serial.println("STOP");
motA.write(0);
motB.write(0);
}
/**
* Displays instructions to user
*/
void displayInstructions()
{
Serial.println("READY - PLEASE SEND INSTRUCTIONS AS FOLLOWING :");
Serial.println("\t0 : Sends 0 throttle");
Serial.println("\t1 : Sends 180 throttle");
Serial.println("\t2 : Runs test function\n");
}