Ok, so far we have used our Arduino Leonardo as a glorified battery pack. We hooked up an LED to 5V and GND, and created light! As simple as it seems, I think it is important to start with simple exercises like this, so we understand exactly what is going on in our circuits, even when they get more and more complex. There are many other tutorials out there that will give you a schematic, and a quick explanation of what it does, but my goal here is to allow readers to develop circuit design skills from the ground up.

With that in mind, here is today’s goal: Get the Arduino to turn on and off an LED at regular intervals.

In order to have the Arduino control an LED, we will need to connect the LED to on of the digital I/O pins, instead of 5V. On the Leonardo, these are labelled 0 to 13, It doesn’t matter which one we use. By writing some code, and uploading that code to the Arduino, we will be able to set the voltage, or read the voltage, of an individual pin. In this case, we will have the Arduino set the voltage of the pin our LED is connected to. Digital pins can be set to either HIGH (+5V) or LOW (0V). We will be setting the voltage of the pin to HIGH to turn on the LED, and LOW to turn in off.

Continue reading →