Connecting an external LED
Luckily, the Arduino boards come with an internal LED connected to pin 13. It is simple to use and always there. But most times we want our own LEDs in different places of our system. We might connect something on top of the Arduino board and can no longer see the internal LED. Here, we will explore how to connect an external LED.
Getting ready
For this recipe, we need the following ingredients:
- An Arduino board connected to the computer via USB
- A breadboard and jumper wires
- A regular LED (the typical LED size is 3 mm)
- A resistor between 220–1,000 ohm
How to do it…
Follow these steps to connect an external LED to an Arduino board:
- Mount the resistor on the breadboard. Connect one end of the resistor to a digital pin on the Arduino board using a jumper wire.
- Mount the LED on the breadboard. Connect the anode (+) pin of the LED to the available pin on the resistor. We can determine the anode on the LED in two ways. Usually, the longer pin is the anode. Another...