As usual I'm a bit confused
I was using the XPT2046_Calibrated.h (and or XPT2046_Touchscreen.h) library to check the settings on a Raspberry pi 3.5 inch touch screen and noticed in the code:
tft.printf("%u-(%u, %u) [%u, %u] {%u, %u}\n", 4-waitloop,touch.x,touch.y, p.x, p.y, sp.x, sp.y);
and then later:
Serial.printf("[X_LO, X_HI] = [%u, %u], [Y_LO, Y_HI] = [%u, %u]\n", xLo, xHi, yLo, yHi);
and I thought cool Serial now supports printf, great. Compiled the test code and yes indeed it compiles and works fine.
Later I said that's cool, now I can use printf in other code, life's good....until...
I tried to compile my code and it gets a unknown member for Serial ????
C:\onedrive\Arduino\libraries\RF24/utility/Teensy/RF24_arch_config.h:22:16: error: 'class usb_serial_class' has no member named 'Serial'
#define printf Serial.printf
^
I did notice that this is an included file but it is the "first" error so it is the one that counts.
I checked the includes for both routines and all of these are in both files as my code also uses the touch screen stuff
#include <SPI.h>
//#include <XPT2046_Touchscreen.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9486_Teensy.h>
#include <XPT2046_Calibrated.h>
#include "MyLCD.h"
#include "ctrl.h"
I guess my real question is does Serial.printf exist?? if not why does the test code for calibration compile?
I attached to original calibration file, but it uses a different tft. Mine is modified for that an a lot stripped/changed out but I felt the original file would be needed as an example. Mine is the 11.6k version. Mine compiles but the third file, using printf does not.
What am I missing?
I was using the XPT2046_Calibrated.h (and or XPT2046_Touchscreen.h) library to check the settings on a Raspberry pi 3.5 inch touch screen and noticed in the code:
tft.printf("%u-(%u, %u) [%u, %u] {%u, %u}\n", 4-waitloop,touch.x,touch.y, p.x, p.y, sp.x, sp.y);
and then later:
Serial.printf("[X_LO, X_HI] = [%u, %u], [Y_LO, Y_HI] = [%u, %u]\n", xLo, xHi, yLo, yHi);
and I thought cool Serial now supports printf, great. Compiled the test code and yes indeed it compiles and works fine.
Later I said that's cool, now I can use printf in other code, life's good....until...
I tried to compile my code and it gets a unknown member for Serial ????
C:\onedrive\Arduino\libraries\RF24/utility/Teensy/RF24_arch_config.h:22:16: error: 'class usb_serial_class' has no member named 'Serial'
#define printf Serial.printf
^
I did notice that this is an included file but it is the "first" error so it is the one that counts.
I checked the includes for both routines and all of these are in both files as my code also uses the touch screen stuff
#include <SPI.h>
//#include <XPT2046_Touchscreen.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9486_Teensy.h>
#include <XPT2046_Calibrated.h>
#include "MyLCD.h"
#include "ctrl.h"
I guess my real question is does Serial.printf exist?? if not why does the test code for calibration compile?
I attached to original calibration file, but it uses a different tft. Mine is modified for that an a lot stripped/changed out but I felt the original file would be needed as an example. Mine is the 11.6k version. Mine compiles but the third file, using printf does not.
What am I missing?