diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2013-01-01 20:11:14 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2013-01-01 20:11:14 -0500 |
commit | 9980bc4622a92c40a03712c0a08dde68cb8e109d (patch) | |
tree | 7c0dbfea74163fa239837a57d440b6c78c1e6b10 | |
parent | a73b01fa664aa9678a7439ca031656bac21dcc0a (diff) | |
download | librambutan-9980bc4622a92c40a03712c0a08dde68cb8e109d.tar.gz librambutan-9980bc4622a92c40a03712c0a08dde68cb8e109d.zip |
examples/blinky.cpp: Use toggleLED() instead of digitalWrite().
Keep things simple.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r-- | examples/blinky.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/examples/blinky.cpp b/examples/blinky.cpp index fad71f8..751475e 100644 --- a/examples/blinky.cpp +++ b/examples/blinky.cpp @@ -6,18 +6,11 @@ void setup() { pinMode(BOARD_LED_PIN, OUTPUT); } -int toggle = 1; - void loop() { - // You could just use toggleLED() instead, but this illustrates - // the use of digitalWrite(): - digitalWrite(BOARD_LED_PIN, toggle); - toggle ^= 1; + togglePin(BOARD_LED_PIN); delay(100); } -// Force init to be called *first*, i.e. before static object allocation. -// Otherwise, statically allocated objects that need libmaple may fail. __attribute__((constructor)) void premain() { init(); } |