USBSerial and HardwareSerial agnostic lib
Posted: Tue Mar 24, 2020 12:57 pm
Hello,
I am writing a lib that takes a Serial port as argument ina function. I would like to make the library agnostic and use both USBSerial and HardwareSerial
For example if i write on a maple mini
It won't work because the Serial is a USBSerial, instead
Would work
How can i write my library to use both?
I am writing a lib that takes a Serial port as argument ina function. I would like to make the library agnostic and use both USBSerial and HardwareSerial
For example if i write on a maple mini
Code: Select all
my_lib(Serial);
Code: Select all
my_lib(Serial1);
How can i write my library to use both?