c:\users\tz24w7\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\cstdio:122:11: error: '::printf' has not been declared
using ::printf;
anyone have any ideas why it wouldn't like printf?
Pretty much every 3rd party platform core provides a printf() method in their Print class. Arduino.cc board platforms are the odd man out as they still refuse to update their Print class to support it.
In the 3rd party platforms you can use:
{print-class-object}.printf(...);
i.e. Serial.printf("hello world\n");
etc...
Here is a way you can add a function called Pprintf() to give you printf functionality in the Arduino environment using the Print class.
It works like fprintf() but instead of passing in a FILE pointer you pass in the Print class object.
i.e. Pprintf(Serial, "Hello world\n");
It will work with any object that has Print class support including things like lcds etc...
So you can format output to them using: Pprintf(lcd, "Hello World");
You can have this by adding this to the top of your sketch or a header file that is included:
Even the ones that don't have "printf() enabled" still have printf() in their libraries (but typically its not "connected" to "Serial"), so this seems more complicated an issue.