diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2011-10-20 22:16:19 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2011-10-20 22:16:19 -0700 |
commit | fc944ff979dbbd49a57722fe2d1d2acf47312eb4 (patch) | |
tree | 38cc3a5c5c8f24f55068fc4ffa73d018169fc2df /libraries/NewSoftSerial/Examples/TwoNSSTest |
Inital commit... halfway through the project
Diffstat (limited to 'libraries/NewSoftSerial/Examples/TwoNSSTest')
-rw-r--r-- | libraries/NewSoftSerial/Examples/TwoNSSTest/TwoNSSTest.pde | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libraries/NewSoftSerial/Examples/TwoNSSTest/TwoNSSTest.pde b/libraries/NewSoftSerial/Examples/TwoNSSTest/TwoNSSTest.pde new file mode 100644 index 0000000..73aa991 --- /dev/null +++ b/libraries/NewSoftSerial/Examples/TwoNSSTest/TwoNSSTest.pde @@ -0,0 +1,33 @@ +#include <NewSoftSerial.h>
+
+NewSoftSerial nss(2, 3);
+NewSoftSerial nss2(4, 5);
+
+void setup()
+{
+ nss2.begin(4800);
+ nss.begin(4800);
+ Serial.begin(115200);
+}
+
+void loop()
+{
+ // Every 10 seconds switch from
+ // one serial GPS device to the other
+ if ((millis() / 10000) % 2 == 0)
+ {
+ if (nss.available())
+ {
+ Serial.print(nss.read(), BYTE);
+ }
+ }
+
+ else
+ {
+ if (nss2.available())
+ {
+ Serial.print(nss2.read(), BYTE);
+ }
+ }
+}
+
|