Hi all,
I am using arduino pro mini in different projects. Hardware serial is now connected to a BLE module, so for debugging purpose I will use some kind of software serial (softwareSerial.h or NeoSWSerial or whatever).
I outsourced parts of my code to own libraries. In the past I had debug parts, where I just debugged via Serial.print(). Now I need to use a software serial class there.
How do I give the existing SoftwareSerial object from main code down to the library classes that I can write the debug logs there?
Can I do it somehow, that I just give a reference of the (Software)-Serial object to the library? How do I make it that it does not matter, if I defined Serial or SoftwareSerial? FunctionNames I am using are equal in both .
Or other approach: how can I create a static logger which all functions (of main code or libs) can call for logging? -> Should need as low resources as possible
Hope it is clear what I want. If not, pls ask for more details.
Thanks, Butch