From c8eabc1cf93e645980eb957732fd2b6ed534c3c7 Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Tue, 3 May 2011 13:14:50 -0400 Subject: [PATCH] Restored and updated SoftwareSerialExample -- really this time! --- .../SoftwareSerialExample.ino | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino diff --git a/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino new file mode 100644 index 000000000..1f535bdef --- /dev/null +++ b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino @@ -0,0 +1,21 @@ +#include + +SoftwareSerial mySerial(2, 3); + +void setup() +{ + Serial.begin(57600); + Serial.println("Goodnight moon!"); + + // set the data rate for the SoftwareSerial port + mySerial.begin(4800); + mySerial.println("Hello, world?"); +} + +void loop() // run over and over +{ + if (mySerial.available()) + Serial.write(mySerial.read()); + if (Serial.available()) + mySerial.write(Serial.read()); +}