0

I wanted to create a function to pass a serial port by reference for reading content. and I use SoftwareSerial and Serial in combination, meaning I want to pass both Objects to the function I want to create. What class do they both inherit from? what class should I declare my source object?

void getResponse(Serial &source){
    ...
}
Abraham
  • 12,140
  • 4
  • 56
  • 92

1 Answers1

1

the common base classes for Arduino Serial and SoftwareSerial are Stream and Print

enter image description here

Juraj
  • 3,490
  • 4
  • 18
  • 25