Serial.print with extra functionality

hey

so i need a to make a function with takes every thing written to the serial console and publishes it to a web server aswell i have been looking at inheritance but had no luck so fare any idear on how this can be don ?

Think about it has having some data and then having one function that sends the data via Serial and another function which sends it to the web.

You have not said what method you are using to connect the Arduino to the web.

...R

You can add functionality by subclassing and inheritance, but then you may run into problems with different serial ports. If you e.g. want to use the Serial Monitor for debug output, the web interface must use a different serial port.

Instead of inheritance I'd suggest specialized functions, where your web output function sends the same strings to both the web and monitor port. This way you have full control over what happens, and don't risk that modified libraries affect other projects.