arduino / ArduinoCore-avr

The Official Arduino AVR core
https://www.arduino.cc
1.25k stars 1.06k forks source link

Create baseclass for HardwareSerial and SoftwareSerial #538

Closed mark5438 closed 1 year ago

mark5438 commented 1 year ago

I know they both inherit stream. But stream can not be written to. Can I make an interface with write functions that they both inherit? Will have some pretty cool applications

per1234 commented 1 year ago

@mark5438 it isn't clear to me what you are proposing. Please provide a detailed proposal.

Isn't this already done by the Print class, which the Stream class inherits?

https://github.com/arduino/ArduinoCore-API/blob/master/api/Print.h