From a884c01c64db5656360e6e5bc3e8f69a708f3478 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Thu, 10 Feb 2011 16:31:23 -0500 Subject: Updated blinky.cpp for portability --- examples/blinky.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'examples/blinky.cpp') diff --git a/examples/blinky.cpp b/examples/blinky.cpp index 45c4528..5611987 100644 --- a/examples/blinky.cpp +++ b/examples/blinky.cpp @@ -2,16 +2,19 @@ #include "wirish.h" -#define TEST_PIN 13 +// Use the pin attached to the built-in LED +#define PIN BOARD_LED_PIN void setup() { - pinMode(TEST_PIN, OUTPUT); + pinMode(PIN, OUTPUT); } int toggle = 1; void loop() { - digitalWrite(TEST_PIN, toggle); + // You could just use toggleLED() instead, but this illustrates + // the use of digitalWrite(): + digitalWrite(PIN, toggle); toggle ^= 1; delay(100); } @@ -22,8 +25,7 @@ void loop() { init(); } -int main(void) -{ +int main(void) { setup(); while (1) { -- cgit v1.2.3