Closed timkoers closed 6 years ago
Works fine for me. I don't think arduino is doing anything to simple math, so this should fall to your compiler. Can you try adding a Serial.printf("%f",second-first);
to see if it is a precision problem?
It has to do with the precision, I multiplied that value by 1000 and something showed up in the Serial monitor. Might be a nice change in the Serial.println()
Hardware:
Board: Node32S Core Installation/update date: 28-06-2018 IDE name: Arduino IDE 1.8.5 Flash Frequency: 80Mhz Upload Speed: 921600
Description:
I am working with floats for the first time within the ESP-32 environment and it is not working as expected.
I am having issues with the results of sscanf and of floating point maths.
When changing the formatter to %.3f for example, the value of temp is 0.00.
I also tried using a %Lf and assigning the value to a double, without usable results.
Sketch:
Debug Messages: