Blinking L E D

**Arduino

Program #1 L.E.D blink**

/* Blinking LED

  • ——

*

  • turns on and off a light emitting diode(LED) connected to a digital
  • pin, in intervals of 2 seconds. Ideally we use pin 13 on the Arduino
  • board because it has a resistor attached to it, needing only an LED

*

*

  • based on an orginal by H. Barragan for the Wiring i/o board

*/

int ledPin = 13; // LED connected to digital pin 13

void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}

void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License