In my last post, I mentioned that I had bought an initial electronics play kit consisting of an Arduino Uno, USB cable, breadboard, jump wires and a selection of LEDs and resistors. I also mentioned that I had access to the book Beginning Arduino by Michael McRoberts.
The first chapter of the book takes you through what the Arduino is, how to install the IDE for programming it and how to upload your first sketch to it (a sketch is a compiled program that is uploaded to the Arduino board from the IDE). It then goes through the Arduino IDE in a bit more detail. The second chapter goes straight into the first project which is to make an LED blink.
Using just the Arduino, breadboard, an LED, a suitable resistor and two jumper wires, I made the circuit that would light the LED from port 10 of the Arduino board. (Note: the Beginning Arduino book explained how to calculate what would be a suitable resistor)
Here is a still photo of the setup:
Now you’re possibly thinking, “that’s easy” or “that’s useless”, and you may be right. But that LED was blinking in a manner controlled by a sketch written by me on my laptop. It was an LED in a circuit that didn’t exist until I built it from the bits I had bought. I found this to be a very exciting moment.
I then extended it by adding two more LED circuits on other ports and changed the sketch to light them up in a traffic light sequence. Here’s a video of what I ended up with:
The 3 LEDs are all different because I bought a lucky-dip bag of LEDs and wasn’t lucky enough to get red, green and yellow of the same type and size.
I then spent the rest of the evening playing with timings and sketches to light the LEDs in different patterns.