Projectitis
Well-known member
Hi all,
I'm modifying a third-party library to work with Teensy, and I'm updating code that writes to stout (debug code using printf mainly) to Serial.printf and equivalents.
Snippet of code is something like this:
However, I'm getting the compiler error:
I've also tried including <Arduino.h> and alternatively <HardwareSerial.h> but no avail.
How do I get Serial output to work in an external library like this?
Cheers,
Peter
I'm modifying a third-party library to work with Teensy, and I'm updating code that writes to stout (debug code using printf mainly) to Serial.printf and equivalents.
Snippet of code is something like this:
Code:
#include <usb_serial.h>
#ifdef HAS_DEBUG
#define DEBUG(fmt, ...) do { Serial.printf("%s(): " fmt "\n", __func__, __VA_ARGS__); } while(0)
#else
#define DEBUG(...)
#endif
However, I'm getting the compiler error:
Code:
error: 'Serial' undeclared
I've also tried including <Arduino.h> and alternatively <HardwareSerial.h> but no avail.
How do I get Serial output to work in an external library like this?
Cheers,
Peter
Last edited: