diff options
| author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-05-02 14:33:05 -0400 |
|---|---|---|
| committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-05-04 13:31:24 -0400 |
| commit | 1634a4855e3d5bf8e3cda2ecb0f4e5f384d057af (patch) | |
| tree | 5cf246a27d1f02ec959893fb62fd8aa754a11e8e /examples/test-serial-flush.cpp | |
| parent | c436ffa1bbe0491738d19b06c2618935603b424f (diff) | |
/examples/ cleanups.
Diffstat (limited to 'examples/test-serial-flush.cpp')
| -rw-r--r-- | examples/test-serial-flush.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/examples/test-serial-flush.cpp b/examples/test-serial-flush.cpp index 6c4e100..adc9c3e 100644 --- a/examples/test-serial-flush.cpp +++ b/examples/test-serial-flush.cpp @@ -4,23 +4,21 @@ #include "wirish.h" -#define COMM Serial1 - void setup() { - COMM.begin(9600); - COMM.println("Hello world!"); + Serial1.begin(9600); + Serial1.println("Hello world!"); } void loop() { - COMM.println("Waiting for multiple input..."); - while (COMM.available() < 5) + Serial1.println("Waiting for multiple input..."); + while (Serial1.available() < 5) ; - COMM.println(COMM.read()); - COMM.println(COMM.read()); - COMM.flush(); + Serial1.println(Serial1.read()); + Serial1.println(Serial1.read()); + Serial1.flush(); - if (COMM.available()) { - COMM.println("FAIL! Still had junk in the buffer..."); + if (Serial1.available()) { + Serial1.println("FAIL! Still had junk in the buffer..."); } } |
