Wiring up an external LED
For our first hardware project, we're going to wire an LED to the Arduino. An LED, or a Light Emitting Diode, is a component that lights up when electric current is passed through it. They come in many colors and sizes and are one of the most easy-to-use and versatile components in hobbyist robotics.
Setting up the hardware
First, take an LED. We'll determine the positive and negative leads of the LED—for this component, it's straightforward: the positive lead is longer than the negative lead.
To wire the LED to an Arduino, place the positive lead on pin 11 and the negative lead on the pin marked GND, just like in the following diagram:
You can also use a breadboard if you wish to—it will look like the following:
Now that we've wired up the LED, we're going to make it blink as we did in the last chapter. The script looks very familiar...