From 9980bc4622a92c40a03712c0a08dde68cb8e109d Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 1 Jan 2013 20:11:14 -0500 Subject: examples/blinky.cpp: Use toggleLED() instead of digitalWrite(). Keep things simple. Signed-off-by: Marti Bolivar --- examples/blinky.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'examples') 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(); } -- cgit v1.2.3