Go Down

Topic: method to read two separate serial ports (Read 444 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 (who) 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.
I speak for myself, not Arduino.

Go Up