aboutsummaryrefslogtreecommitdiffstats
path: root/examples/blinky.cpp
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-02-10 16:31:23 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-02-10 16:31:23 -0500
commita884c01c64db5656360e6e5bc3e8f69a708f3478 (patch)
tree65ec93ceb3c85c7a861cc6744d4397128cb4320c /examples/blinky.cpp
parent2a0c7510fb91ba4a11b6772a8ae72685823907f8 (diff)
downloadlibrambutan-a884c01c64db5656360e6e5bc3e8f69a708f3478.tar.gz
librambutan-a884c01c64db5656360e6e5bc3e8f69a708f3478.zip
Updated blinky.cpp for portability
Diffstat (limited to 'examples/blinky.cpp')
-rw-r--r--examples/blinky.cpp12
1 files changed, 7 insertions, 5 deletions
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) {