AT90USB1286 and sketch compatibility

I currently have a sketch that converts a float to a string

stringVariable = String(floatVariable, 2);

this code works for arduino uno, or leonardo.

It doesn't work for Industruino 1286. It gives this error:

error: call of overloaded 'String(float&, int)' is ambiguous

 

Julio
Julio
17
| 1 0 0
Asked on 12/21/15, 11:37 AM
1
vote
3010 Views

Use the dtostrf() arduino built-in function.  I found the following in a google search:

Float to string using String class and sprintf %f do not work in Arudino compiler (removed because very slow)

Gary Huband
Gary Huband
57
| 4 1 1
Answered on 1/4/16, 4:24 PM
1
vote

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

18 follower(s)

Stats

Asked: 12/21/15, 11:37 AM
Seen: 3010 times
Last updated: 1/4/16, 4:24 PM