I am broadcasting a fixed value float over a HC-12 radio which is then received by another HC-12 radio. I am then trying to convert that String to a Float which requires 6 decimal places. However, when I print the String value out and then the Float value out, I get two different answers.
String lat=getValue(_msg, '|', 6); // Function to get lat value from incoming message Serial.println(lat); Serial.println(lat.toFloat(), 6);
This then results in the following values being displayed to the user:
The value 51.507401 is the correct value, so I would ideally like the float value to be the same.