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:
A solution can be found by reading the AVR documentation for the printf family of functions that will lead you to vfprintf… at the bottom there it describes compiler flags needed for properly linking in the full functionality (see following link):
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:
I would recommend simply adding the file “platform.local.txt” and in that file adding the following line:
compiler.c.elf.extra_flags=-Wl,-u,vfprintf -lprintf_flt -lm
That should do it. Floats will now be printed instead of “?”.
NOTE: When enabling the full vfprintf library, my code memory footprint (flash) increased by 1472 bytes.