To support the tutorial example, we need the following material:
- An Arduino board (Arduino Uno atmega328p)
- A breadboard to support the wiring of the different components
- A 7-segments display to act as a counter
- an LED
- a push-button
For clarity purposes, we divided the wiring into two steps. First the “button + LED” one, and then the 7-segments displayer.
To set up the “Switch the light on!” part of the tutorial, you’ll have to:
- Connect the LED to digital 13 (D13) with a 220-ohm resistor. (long leg to digital 13)
- connect the button to digital 10 (D10) and a 220-ohm resistor.
To support the “count to 9” part of the tutorial, we will connect the differents ports to pins D1 to D7 on the Arduino board.
Classically, 7-segments displays can be “common cathode” or “common anode”. The working displayed here is for a “common anode”. If you experience troubles while wiring the display (e.g., you’re witnessing an inverted display), just invert anode and cathode.