'how to convert float to string correctly in avr c [duplicate]
I need to convert a float value to a string in my avr project. Therefore I tried it with the following code:
char buf[10];
float emg1 = 33.42;
sprintf(buf, "%f", emg1);
uart_puts(buf);
But the output is only a "?". I tried to change the char format from %f to %g but I only got "?".
Is there another way to simply convert float to string, or can somebody tell me where the mistake is?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
