Print to USB and UART at the same time

Its a Pro Micro (ATmega32U4).

How do i need to change this that it also prints to Serial1 (UART):

#define print(...)   Serial.print(__VA_ARGS__)
#define println(...) Serial.println(__VA_ARGS__)

void setup() {
    Serial.begin(9600, SERIAL_7E2);
    println();
    println(F("Test"));
    println();
}

This does not work:

#define print(...)   Serial.print(__VA_ARGS__)
#define println(...) Serial.println(__VA_ARGS__)
#define print(...)   Serial1.print(__VA_ARGS__)
#define println(...) Serial1.println(__VA_ARGS__)

void setup() {
    Serial.begin(9600, SERIAL_7E2);
    Serial1.begin(9600, SERIAL_7E2);
    println();
    println(F("Test"));
    println();
}

What's wrong with

Serial.println("my text");
Serial1.println("my text");

If you explain the purpose of what you are trying to do it will be easier to help.

...R

You could use my NeoTee class:

#include <NeoTee.h>

Print *outputs[] = { &Serial, &Serial1 };
NeoTee tee( outputs, 2 );

#define print(...)   tee.print(__VA_ARGS__)
#define println(...) tee.println(__VA_ARGS__)

void setup()
{
  Serial .begin(9600, SERIAL_7E2);
  Serial1.begin(9600);

  println();
  println(F("Test"));
  println();
}

void loop() {}

Robin2:
What's wrong with

Serial.println("my text");

Serial1.println("my text");

That you have to write everything twice...

@-dev, thanks that works.

Or just fix your macros to do it:

#define print(...)   Serial.print(__VA_ARGS__); Serial1.print(__VA_ARGS__)
#define println(...) Serial.println(__VA_ARGS__);  Serial1.println(__VA_ARGS__)

--- bill

you have to write everything twice...

Yes, but you could put the actual output code in a function and call it with the text or data to be printed as a parameter. One function call, two outputs.

Another way but using hardware:
http://nicecircuits.com/dual-port-serial-terminal/