i am transmitting sensor data from my atmega328p to my esp8266. The Sensordata has 3 decimal places. The esp8266 sends this data to my pc and there I see only two digits. This is because the data is saved with two digits in the float variables. Is there a way to save them with 3? The way to multiply and later to divide does not work because of some issues on my pc server so I need to hand it straight with 3 digits.
1 Answer
This is because the data is saved with two digits in the float variables.
No, it's not. It's because Serial.println()
by default prints only 2 decimal places. You can specify the number of decimal places to print in the function:
Serial.println(myVal, 3);