aboutsummaryrefslogtreecommitdiff
path: root/csource/Blink/Blink.cpp
diff options
context:
space:
mode:
authorDonald Delmar Davis <don@suspectdevices.com>2012-09-16 21:51:36 -0700
committerDonald Delmar Davis <don@suspectdevices.com>2012-09-16 21:51:36 -0700
commita8804b81b822cb630932a6c20e39e018dd2e380c (patch)
tree33bd3cfd74aba2a3e8d0241b07f2d993d00faf96 /csource/Blink/Blink.cpp
parentb3de2f8acd1c134b53a115fae8a7c5b44463e4bd (diff)
Add core from arduino-0022, Arduino.mk, include file a test example and Makefile.
Diffstat (limited to 'csource/Blink/Blink.cpp')
-rw-r--r--csource/Blink/Blink.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/csource/Blink/Blink.cpp b/csource/Blink/Blink.cpp
new file mode 100644
index 0000000..1f97f77
--- /dev/null
+++ b/csource/Blink/Blink.cpp
@@ -0,0 +1,30 @@
+/*
+ Blink
+ Turns on an LED on for one second, then off for one second, repeatedly.
+ This example code is in the public domain.
+ */
+
+#if defined(ARDUINO) && ARDUINO >= 100
+#include "Arduino.h"
+#else
+#include "WProgram.h"
+#endif
+
+#ifndef BOARD_LED
+#define BOARD_LED 13
+#endif
+
+void setup();
+void loop();
+
+void setup() {
+ pinMode(BOARD_LED, OUTPUT);
+}
+
+void loop() {
+ digitalWrite(BOARD_LED, HIGH); // set the LED on
+ delay(1000); // wait for a second
+ digitalWrite(BOARD_LED, LOW); // set the LED off
+ delay(500); // wait for a half a second
+}
+