Introduction to Arduino

Flashing a Single LED

Arduino UNO R3 Pin Setup

Photo of the Setup


    This project shows you a method of making a single external LED (Light Emitting Diode) flash at set intervals. You can change the rate of flashing by altering the “delay” values in the code. Notice that this code is similar to your first project, we are just adding an external LED to Pin 13.

    Take a look at the comments (the text after the “//” symbols) above each command. See if you can start to spot patterns in the code. A great way to write your own code is to copy and paste sections of your already existing code and modify the copied code to fit your new project.

    NOTE: An external LED needs a resistor in the circuit to keep it from burning out. The higher the resistance, the dimmer the LED will appear but the longer it will last.

    NOTE: Make sure the long lead on the LED is connected to positive (pin 13 in this case); LEDs are directional and won’t work if these connections are reversed.

Parts List:
    1 LED
    1 220 Ohm Resistor
    1 Arduino UNO R3
    1 Breadboard
    Connector Wires


    //------------- Code Starts Here ----------------------------
    //Published by
    //Created by Paul Illsley (
    //Please use and share so others can enjoy
    void setup() {
    // setting pin 13 (the LED) as an output (this is also the pin for the UNO's on-board LED).
    void loop() {
      // setting the voltage of pin 13 to HIGH (5 volts), the LED turns on
      // delay 1000 milliseconds (1 second)
      // setting the voltage of pin 13 to LOW (0 volts), the LED turns off
      // delay 1000 milliseconds (1 second)
    //------------- Code Stops Here ----------------------------

    Created by Paul Illsley

    Return to