From 86cd280a5d6436bca15cb2b541b3fc868d38c9fa Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 29 Aug 2017 18:32:52 +0200 Subject: [PATCH] add example blink code --- src/main.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main.cpp diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..304d6fa --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,32 @@ +/** + * Blink + * + * Turns on an LED on for one second, + * then off for one second, repeatedly. + */ +#include "Arduino.h" + +#ifndef LED_BUILTIN +#define LED_BUILTIN 13 +#endif + +void setup() +{ + // initialize LED digital pin as an output. + pinMode(LED_BUILTIN, OUTPUT); +} + +void loop() +{ + // turn the LED on (HIGH is the voltage level) + digitalWrite(LED_BUILTIN, HIGH); + + // wait for a second + delay(1000); + + // turn the LED off by making the voltage LOW + digitalWrite(LED_BUILTIN, LOW); + + // wait for a second + delay(1000); +}