Skip to content

Commit

Permalink
MultiSerialMega example is now bi-directional
Browse files Browse the repository at this point in the history
  • Loading branch information
tigoe committed May 20, 2012
1 parent 6f1e54a commit c3a9b30
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* Serial monitor open on Serial port 0:
created 30 Dec. 2008
by Tom Igoe
modified 20 May 2012
by Tom Igoe & Jed Roach
This example code is in the public domain.
Expand All @@ -30,4 +31,10 @@ void loop() {
int inByte = Serial1.read();
Serial.write(inByte);
}

// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial1.write(inByte);
}
}

0 comments on commit c3a9b30

Please sign in to comment.