From 861d2ff72f9597c5ca0e486437a7c73f3262cc69 Mon Sep 17 00:00:00 2001 From: Sudar Date: Sat, 28 Mar 2015 19:40:50 +0530 Subject: [PATCH] Add a new example to show how serial monitor can be used --- examples/README.md | 4 +--- examples/SerialPrint/Makefile | 5 +++++ examples/SerialPrint/SerialPrint.ino | 10 ++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 examples/SerialPrint/Makefile create mode 100644 examples/SerialPrint/SerialPrint.ino diff --git a/examples/README.md b/examples/README.md index 39425b3..631704d 100644 --- a/examples/README.md +++ b/examples/README.md @@ -3,9 +3,7 @@ the different usage patterns - BlinkInAVRC - Shows how to use plain AVR C code - ATtinyBlink - Shows how to use different cores like ATtiny - -These three examples are a step back, in the "tests" directory. - - Blink - Shows normal usage - HelloWorld - Shows how to include Arduino libraries +- SerialPrint - Shows how serial monitor can be used - BlinkChipKIT - Shows how to use ChipKIT diff --git a/examples/SerialPrint/Makefile b/examples/SerialPrint/Makefile new file mode 100644 index 0000000..f9d5cf4 --- /dev/null +++ b/examples/SerialPrint/Makefile @@ -0,0 +1,5 @@ +# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile + +BOARD_TAG = uno + +include ../../Arduino.mk diff --git a/examples/SerialPrint/SerialPrint.ino b/examples/SerialPrint/SerialPrint.ino new file mode 100644 index 0000000..e129c9d --- /dev/null +++ b/examples/SerialPrint/SerialPrint.ino @@ -0,0 +1,10 @@ +void setup() { + Serial.begin(9600); + Serial.print("Press any key: "); +} + +void loop() { + if (Serial.available()) { + Serial.println(Serial.read()); + } +}