ATTinyCore icon indicating copy to clipboard operation
ATTinyCore copied to clipboard

Unable to convert float to String

Open gril002 opened this issue 8 years ago • 1 comments

Trying to convert a float into a string compiling for the ATtiny85 will result in the following error:

`C:\Users\Gašper Gril\Desktop\a\a.ino: In function 'void loop()':

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

C:\Users\Gašper Gril\Desktop\a\a.ino:7:39: note: candidates are:

In file included from C:\Users\Gašper Gril\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.4\cores\tiny/Arduino.h:225:0,

                 from C:\Users\GAPERG~1\AppData\Local\Temp\arduino_build_749134\sketch\a.ino.cpp:1:

C:\Users\Gašper Gril\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.4\cores\tiny/WString.h:65:2: note: String::String(long unsigned int, unsigned char)

  String(unsigned long, unsigned char base=10);

  ^

C:\Users\Gašper Gril\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.4\cores\tiny/WString.h:64:2: note: String::String(long int, unsigned char)

  String(long, unsigned char base=10);

  ^

C:\Users\Gašper Gril\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.4\cores\tiny/WString.h:63:2: note: String::String(unsigned int, unsigned char)

  String(unsigned int, unsigned char base=10);

  ^

C:\Users\Gašper Gril\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.4\cores\tiny/WString.h:62:2: note: String::String(int, unsigned char)

  String(int, unsigned char base=10);

  ^

exit status 1
call of overloaded 'String(float, int)' is ambiguous`

Compiling this for an Arduino works fine.

gril002 avatar Dec 12 '17 21:12 gril002

Looks like it's using an older version of String, need to get the right one and make sure there aren't any issues with it.

SpenceKonde avatar Dec 13 '17 06:12 SpenceKonde