aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2013-01-01 20:11:14 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2013-01-01 20:11:14 -0500
commit9980bc4622a92c40a03712c0a08dde68cb8e109d (patch)
tree7c0dbfea74163fa239837a57d440b6c78c1e6b10
parenta73b01fa664aa9678a7439ca031656bac21dcc0a (diff)
downloadlibrambutan-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.cpp9
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();
}