Setting up an LED to blink using the arduino.
Light Emitting Diode (LED)
Resistor
Wires
Breadboard
Arduino NG
Here is my code for the Arduino. I used a random number for the blinking on and off to make it a little annoying ;)
/*
* Blink
*/
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(random(500,5000)); // waits for a random time between half a second to 5 seconds
digitalWrite(ledPin, LOW); // sets the LED off
delay(random(500,5000)); // waits for a random time between half a second to 5 seconds
}