2 Brushless motor with ESC only one works with servo library ?

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");
}

What do the ESC instructions say about it continually beeping? It often means that no signal is detected (probably a bad connection to pin5) or sometimes that the ESC has failed to initialise.

If you swap the ESCs over so the one that works is now on pin 5 what happens?

Steve

Yes, I've swap both and changed to other pins, it seems only pin 4 is working... I've used a Oscilloscope to check the signal on most ports, only pin 4 seems to send the ppm output, but I verified with PWM, these ports work correctly...

So you've tried different pins e.g. 9 and 10 and then neither ESC works? Only connecting to pin 4 works. And this is a normal Uno?

I have trouble even imagining what could cause that unless perhaps you're using a non-standard or corrupted Servo library.

Steve

I've used a Arduino Uno and a Mega 2560... I haven't checked the servo Library though

Same thing when reinstalling the servo library but when i tried on pin 10 and 11 the pin 11 worked but not the pin 10...

Works again !!! you were right, it must have been the library, thanks a lot !