Go Down

Topic: method to read two separate serial ports (Read 383 times) previous topic - next topic


I'm not sure how to accomplish what I'd like.  The code below obviously doesn't work:

main sketch:
Code: [Select]

  if (Serial1.available () > 0) {
  }  // end of incoming data

  if (Serial3.available () > 0) {
  }  // end of incoming data


Code: [Select]

void Comms::method(int port){

int inByteT = Serial(port).read();

can someone point me in the right direction?


Switch/case or an array.

Make sure you get the correct spelling of "method"
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131