summaryrefslogtreecommitdiff
path: root/libraries/NewSoftSerial/Examples/NewSoftSerialTest
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-10-20 22:16:19 -0700
committerJesse Morgan <jesse@jesterpm.net>2011-10-20 22:16:19 -0700
commitfc944ff979dbbd49a57722fe2d1d2acf47312eb4 (patch)
tree38cc3a5c5c8f24f55068fc4ffa73d018169fc2df /libraries/NewSoftSerial/Examples/NewSoftSerialTest
Inital commit... halfway through the project
Diffstat (limited to 'libraries/NewSoftSerial/Examples/NewSoftSerialTest')
-rw-r--r--libraries/NewSoftSerial/Examples/NewSoftSerialTest/NewSoftSerialTest.pde25
1 files changed, 25 insertions, 0 deletions
diff --git a/libraries/NewSoftSerial/Examples/NewSoftSerialTest/NewSoftSerialTest.pde b/libraries/NewSoftSerial/Examples/NewSoftSerialTest/NewSoftSerialTest.pde
new file mode 100644
index 0000000..0d9e815
--- /dev/null
+++ b/libraries/NewSoftSerial/Examples/NewSoftSerialTest/NewSoftSerialTest.pde
@@ -0,0 +1,25 @@
+
+#include <NewSoftSerial.h>
+
+NewSoftSerial mySerial(2, 3);
+
+void setup()
+{
+ Serial.begin(57600);
+ Serial.println("Goodnight moon!");
+
+ // set the data rate for the NewSoftSerial port
+ mySerial.begin(4800);
+ mySerial.println("Hello, world?");
+}
+
+void loop() // run over and over again
+{
+
+ if (mySerial.available()) {
+ Serial.print((char)mySerial.read());
+ }
+ if (Serial.available()) {
+ mySerial.print((char)Serial.read());
+ }
+}