Last active
August 29, 2015 14:16
-
-
Save krobro/d02e036ff1d97c5725b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Blink | |
// | |
// The basic Arduino example. Turns an LED on for one second, | |
// then off for one second, and so on forever ... or until you | |
// turn the Duinobot off. | |
// | |
// We use pin 13 as depending on the Arduino board | |
// (the Duinobot in our case), it has either: | |
// - a built-in LED or, | |
// - a built-in resistor so that you only need to add an LED. | |
// | |
// NOTES: | |
// - The Duinobot has an LED so we do not have to add anything. | |
// - See http://www.arduino.cc/en/Tutorial/Blink for the original | |
// tutorial. | |
// | |
int ledPin = 13; // LED connected to digital pin 13 | |
void setup() // run once, when the sketch starts | |
{ | |
pinMode(ledPin, OUTPUT); // sets the digital pin as output | |
} | |
void loop() // run over and over again | |
{ | |
digitalWrite(ledPin, HIGH); // sets the LED on | |
delay(500); // waits for a second | |
digitalWrite(ledPin, LOW); // sets the LED off | |
delay(500); // waits for a second | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment