Adding printf to Print.h

I've done this in the past with no problems, following the instructions here:

https://playground.arduino.cc/Main/Printf

But, this time, with v1.8.2, its not working - printf is still undefined when I do a build.

What's the trick? Is there a missing step, or something that has changed in v1.8.2? Worked find when I did it to the Due package, but is not working for the AVR package under the IDE install directory.

The path to the Print.h I edited was:

E:\Users\RayL\Documents\Arduino\IDEInstalls\arduino-1.8.2\hardware\arduino\avr\cores\arduino\Print.h

Regards,
Ray L.

The problem appears to be the build is not re-building the core. I intentionally inserted syntax errors into the Print source code, and was still able to do a successful build.

So, I think the question is: How do I force a rebuild of the AVR core?

Regards,
Ray L.

Oops! My bad! I have two copies of the IDE installed, and was editing the wrong one!

Regards,
Ray L.

RayLivingston:
I've done this in the past with no problems, following the instructions here:

Arduino Playground - Printf

All you need is this: GitHub - krupski/Stdinout: Standard input/output/error support for Arduino

And this: GitHub - krupski/Print: Improved Print functionality for Arduino (including stream support, print_P and related). is a huge improvement on the stock Arduino code.

I like the stdinout part, but where is printf in there?

Regards,
Ray L.

RayLivingston:
I like the stdinout part, but where is printf in there?

Regards,
Ray L.

“printf” is already “in there” (it’s loaded by Arduino.h when it “includes” <stdio.h>).

As it sits, printf goes nowhere. But if you include my Stdinout library and then use “STDIO.open (Serial)” you will see that printf now goes to the serial port.

Make sense?

BTW, to make the best of it, you should also use the extended print library.

For this one, you go into your Arduino directory, rename Print.cpp and Print.h to something like Print.cpp.bak and Print.h.bak, then COPY the new Print.cpp and Print.h into the directory.

RayLivingston:
The problem appears to be the build is not re-building the core. I intentionally inserted syntax errors into the Print source code, and was still able to do a successful build.

So, I think the question is: How do I force a rebuild of the AVR core?

Regards,
Ray L.

I have same issue. But I have only one Arduino IDE. Even if I delete print.h from AVR {installdir}/hardware/arduino/cores/arduino Serial.println compiles with no error.

ok, found a solution. Windows keeps copy of print.h in temp folder - \AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino

Plejsq:
ok, found a solution. Windows keeps copy of print.h in temp folder - \AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino

this is the boards packages installation folder