summaryrefslogtreecommitdiff
path: root/arduino_libs_0022/NewSoftSerial/Examples/NewSoftSerialTest
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-01-18 18:02:10 +0000
committerTim Redfern <tim@eclectronics.org>2012-01-18 18:02:10 +0000
commit8c3efb592b16b672fc353368c04d88d3a32cf1a2 (patch)
tree9cf4887292432c656651012c5370009b4a69cddf /arduino_libs_0022/NewSoftSerial/Examples/NewSoftSerialTest
parentfe92239d966f0219e8b7caf6335a776938b4e0e3 (diff)
updated previous demo to Arduino 1.0HEADmaster
Diffstat (limited to 'arduino_libs_0022/NewSoftSerial/Examples/NewSoftSerialTest')
-rw-r--r--arduino_libs_0022/NewSoftSerial/Examples/NewSoftSerialTest/NewSoftSerialTest.pde25
1 files changed, 25 insertions, 0 deletions
diff --git a/arduino_libs_0022/NewSoftSerial/Examples/NewSoftSerialTest/NewSoftSerialTest.pde b/arduino_libs_0022/NewSoftSerial/Examples/NewSoftSerialTest/NewSoftSerialTest.pde
new file mode 100644
index 0000000..0d9e815
--- /dev/null
+++ b/arduino_libs_0022/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());
+ }
+}