Go Down

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

Loren

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) {
    comms.mehtod(1);
  }  // end of incoming data

  if (Serial3.available () > 0) {
    comms.method(3);
  }  // end of incoming data




comms:

Code: [Select]


void Comms::method(int port){

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


can someone point me in the right direction?

AWOL

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!

Arduino
via Egeo 16
Torino, 10131
Italy