There are ways to re-enable the floating point support in printf, but it involves hacking around in the internals of your IDE installation, and makes anything that then uses printf much bigger.
Better is to either pre-format your floats into strings using dtostrf(), or to manually print the two parts (integer and decimal) of the float manually:
majenko:
There are ways to re-enable the floating point support in printf, but it involves hacking around in the internals of your IDE installation, and makes anything that then uses printf much bigger.
Better is to either pre-format your floats into strings using dtostrf(), or to manually print the two parts (integer and decimal) of the float manually:
For those using an AVR board that want to know more about customizing the Arduino IDE and allowing the extra overhead of the full printf related tools, read on:
The problem is that knowing where to put the compiler flags can be difficult. Compiler options are found in a file called "platform.txt" and in this case we want to add to "compiler.c.elf.extra_flags". If you want to add your own flags without messing up the default Arduino files then use "platform.local.txt" (you will have to create this file). Assuming Windows, for standard Arduino boards, the path to these files is similar to:
*C:\Program Files (x86)\Arduino\hardware\arduino\avr*
If you have a non-standard board, you will need to modify folder options to show hidden folders, and the path is similar to:
_C:\Users*\AppData\Local\Arduino15\packages*\hardware\avr**_
I would recommend simply adding the file "platform.local.txt" and in that file adding the following line: