Description
Make the LED (Light Emitting Diode) blink using the Arduino board.
Components Used
LED (Light Emitting Diode)
20-ohm resistor (red, red, brown, gold)
Arduino Code
/* Blinking LED
* ------------
*
* Created September 5, 2007
*
* Turns on and off a LED connected to digital pin 13. Pin 13 has a
* resistor attached to it requiring only the LED to make this work.
* For the sake of practice, the circuit with the resistor was created.
* based on: http://www.arduino.cc/en/Tutorial/Blink
*/
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
}
Item
lab1 - breadboard with blinking LED
Comments
feedback
perfect! thanks!