From c3a9b304e15b89614e715771027737ecfc6250d3 Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Sat, 19 May 2012 19:55:25 -0700 Subject: [PATCH] MultiSerialMega example is now bi-directional --- .../4.Communication/MultiSerialMega/MultiSerialMega.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/shared/examples/4.Communication/MultiSerialMega/MultiSerialMega.ino b/build/shared/examples/4.Communication/MultiSerialMega/MultiSerialMega.ino index 684e305bb..2764cba5a 100644 --- a/build/shared/examples/4.Communication/MultiSerialMega/MultiSerialMega.ino +++ b/build/shared/examples/4.Communication/MultiSerialMega/MultiSerialMega.ino @@ -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. @@ -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); + } }