diff options
| author | Sudar <sudar@sudarmuthu.com> | 2015-03-28 19:40:50 +0530 |
|---|---|---|
| committer | Sudar <sudar@sudarmuthu.com> | 2015-03-28 19:40:50 +0530 |
| commit | 861d2ff72f9597c5ca0e486437a7c73f3262cc69 (patch) | |
| tree | 75d71fb3a26ed57336195729622d1265e8490290 | |
| parent | 6f326e6e2625fb66f77891117647b37144e97714 (diff) | |
Add a new example to show how serial monitor can be used
| -rw-r--r-- | examples/README.md | 4 | ||||
| -rw-r--r-- | examples/SerialPrint/Makefile | 5 | ||||
| -rw-r--r-- | examples/SerialPrint/SerialPrint.ino | 10 |
3 files changed, 16 insertions, 3 deletions
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()); + } +} |
