aboutsummaryrefslogtreecommitdiffstats
path: root/examples/test-serial-flush.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/test-serial-flush.cpp')
-rw-r--r--examples/test-serial-flush.cpp20
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...");
}
}