Controlling two External LEDs

In this project, you'll learn how to connect and control two external LEDs.

Parts needed:
  • Arduino
  • 2x LED (any color)
  • 2x 150 Ω resistors (brown-green-brown) or (brown-green-black-black)
  • Wires
  • Breadboard
Software stuff you'll learn:
LED     150 ohm resistor 150 ohm resistor
1 Making the connections

Connect two LEDs to the Arduino board, one to pin 2 and one to pin 3.
  • Connect the positive end (long leg) of one LED to pin 2 on the Arduino board.
  • Connect the negative end (short leg) of the LED to one end of the 150 ohm resistor.
  • Connect the other end of the resistor to GND on the Arduino board.
  • Connect the positive end (long leg) of a second LED to pin 3 on the Arduino board.
  • Connect the negative end (short leg) of the LED to one end of the 150 ohm resistor.
  • Connect the other end of the resistor to GND on the Arduino board.
Two LEDs connections
2 Create a new Bare Minimum program by selecting File from the menu
  • then select Examples
  • then select Basics
  • then select BareMinimum

Then type in this program.


Notice that this program is very similar to the one external LED program. The only difference is that all of the commands are duplicated, one set for controlling the LED connected to pin 2, and the other set for controlling the LED connected to pin 3.
Two LEDs
3 Run the program. You should see both of the external LEDs blink on for 1 second and then off for another second.