How do i use another serial to send data from arduino to processing?

i am using arduino teensy and i want to send data to processing using another serial, how do i write it in processing?
i am following this tutorial: https://www.youtube.com/watch?v=NhyB00J6PiM
but in my case, i need to use another serial, because Serial.begin already used for big program, so for example i need to use Serial2.begin(9600)
arduino code:

void setup() {
  Serial.begin(115200); // already used 
  Serial2.begin(9600); // processing
}
void loop() {
  Serial.println("...") //big code that i am not allow to change
  Serial2.println("hello world");
  delay(1000);
}

so how do i get Serial2.println value instead of Serial.println in processing

1 Like

i think this is a Teensy hardware question,
the 3.x models have 3 add UARTs to the default USB port ( and serial.print() )
to access the others need to find the port - pins
UART Serial2 ( 9 - RX2 / 10 TX2 )
and connect some hardware

USB to TTL Serial Cable - Debug / Console Cable

to be able to connect it to a PC USB port ( check on 5v or 3V5 version? )

1 Like