I have the following code for an Arduino sketch:
#include
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
static FILE lcdout = {0} ;
static
The GNU toolchain for AVRs (which is included with the Arduino IDE) uses a "minified" version of the C standard library by default, in which, for example, the floating-point support is reduced/taken away from formatted I/O functions (just in order printf()
to fit in the few kBytes long storage of the chip.)
If you want this to work, you have to link agains another library containing the normal version of printf()
, by using the -Wl,-u,vfprintf -lprintf_flt
linker flags.