Arduino – Blinking LED


This recipe teaches you how to make an LED blink using an Arduino. LED’s are used in Arduino projects as a way to communicate system status to users.

Make sure to use the 220 Ohm resistor between pin 8 and the LED or the current will be too high for the LED and will burn it out.

When dealing with LED’s the Long Leg of the LED is Positive, and the Short Leg is ground.


  • Breadboard
  • LED
  • 220 Resistor
  • Wires


#define greenLED 8

void setup() {
  pinMode(greenLED, OUTPUT);

void loop() {
digitalWrite(greenLED, HIGH);
digitalWrite(greenLED, LOW);
}Code language: PHP (php)

Extra Credit:

Use a Green, Yellow and Red LED.

Connect them to individual Digital Pins

Create code to:

  • Turn on Only Green LED, wait 1 second
  • Turn on Only Yellow LED, wait 1 second
  • Turn on Only Red LED, wait 1 second
  • Turn ON ALL LED’s, wait 1 second
  • Turn OFF ALL LED’s, wait 1 second