call of overloaded 'String(float&)' is ambiguous

I am using mega 2560 pro. When I try to transfer program to the board I recieve following message.

exit status 1
call of overloaded ‘String(float&)’ is ambiguous

When I tried out code on arduino uno it worked without any issues.
Here is the part of code that triggers error.


Any help is appreciated.

The String class is best avoided in the Arduino world. It’s a memory hog and can do bad things to your heap memory.

Your line could be:


For the same result with less code space and better performance.

Strings cause memory problems and program crashes. Avoid them and instead, use

Serial.println(" m/s");