Hello!
I am building a project with 2 adrduinos. I want to read in the same processing program both their serials, but I cannot understand how serialEvent() works for two serial ports.
the below code does not work and i get the error:
"Duplicate method serialEvent(Serial) in type my_program_name"
if i have only one serialEvent() method how can i make it work seperately for each serial port?
I am building a project with 2 adrduinos. I want to read in the same processing program both their serials, but I cannot understand how serialEvent() works for two serial ports.
the below code does not work and i get the error:
"Duplicate method serialEvent(Serial) in type my_program_name"
void serialEvent(Serial myPort) {
input = (myPort.readString());
}
void serialEvent(Serial myPort2) {
input2 = (myPort2.readString());
}
if i have only one serialEvent() method how can i make it work seperately for each serial port?
1