How to convert an unsigned char value into a float or double in coding in AVR studio 4.?
Please help I am a beginner, my question may sound stupid too :/
Like I have got a char keyPressed
and I have printed it on the screen using lcd_gotoxy(0,0); lcd_puts (keyPressed);
Now I want to use this value to calculate something.. How to convert it into float or double? please help
For character array input you can use
atof
.if you want for example character 'a' as 65.0 in float then the way to do this is
if you want for example character '9' as 9.0 in float then the way to do this is
if you want to convert character array containing number to float here is the way
for more refer to link: http://en.cppreference.com/w/cpp/string/basic_string/stof http://www.cplusplus.com/reference/string/stof/