"no matching function for call to 'Servo::write(String&)'" Error

Hello,

I need some help in my project. I used ESP to communicate between a client through the browser and the arduino. The client is supposed to sent a value to esp, and then esp will send it to arduino. This value used to run BLDC motor in a speed regarding to what the client send.
My problem is, when I try to use this value to drive the motors, I got this error message: "no matching function for call to 'Servo::write(String&)'".
I believe that the error reason is servo can not deal with string, but how can i solve this problem?

You can convert a String to an int:

Ak96:
I believe that the error reason is servo can not deal with string

Note that a String and a string are two different things. It's generally advised to never use String for Arduino projects, even though the authors of the ESP8266 hardware package used them quite often:

Great !
Now it works. Thank you bro.

I have some more question if you don't mind.

Now in Arduino sketch, I'm using this code in the loop

{

char U;
String content = "";
 while (ArduinoUno.available()){  // To read from ESP
   U= ArduinoUno.read();
   content.concat(U);
   }
int speed= content.toInt();
esc_signal.write(speed);  
 Serial.println(speed);
 delay(2000);
}

As you can see, there is delay for 2 seconds that i can't delete it because that will cause the motors to do not work. But it caused another problems:

  1. the motos will work for 2s and then stop for a while, and then work then stop...
  2. if i try to increase the delay, for example to 25s, the motors will not receive any new values from the client until the 25s elapse.

So, what can do to make the motors run without stop and receive and apply the values from client instantaneously ?

i can't delete it because that will cause the motors to do not work

Nonsense. Somewhere else you must be turning them off prematurely.

So, what can do to make the motors run without stop and receive and apply the values from client instantaneously ?

Separate receiving the data from using the data.