embeded/arduino(genuino)2016. 3. 31. 19:03

엥? winavr에서도 안되었던가??

급 멘붕 ㄷㄷ


char *dtostrf(double val, signed char width, unsigned char prec, char *s)


Use this method to convert it to a C-Style string and then use sprintf, eg:


char str_temp[6];


/* 4 is mininum width, 2 is precision; float value is copied onto str_temp*/

dtostrf(temp, 4, 2, str_temp);

sprintf(temperature,"%s F", str_temp);

[링크 : http://stackoverflow.com/questions/27651012/arduino-sprintf-float-not-formatting]

[링크 : http://forum.arduino.cc/index.php?topic=175478.0]


[링크 : http://whiteat.com/bPDS_AVR/28406]

Posted by 구차니