Arduino 2-Digit 7-Segment Display with Buttons
This week we modify the original circuit and sketch to include two buttons, one to control each digit of the display.
Here’s what the setup looks like:
And here’s the complete sketch:
Continue Reading »
Arduino 2-Digit 7-Segment Display Counter
This month’s Arduino project is to build two 2-digit 7-segment LED display circuits and sketches, one that counts up and one that counts up using mini push buttons. The next posts will explain the circuits and the Arduino sketches.
Materials:
- Arduino Duemilanove
- 1 2-digit 7-segment display (I got a 50-piece LED display grab bag
for better value; the one I used was configured as shown) - 2 Mini push button switches
- 9 Resistors, 100 Ohm
- 2 Resistors, 10K Ohm
- 2 2N3906 transistors (PNP)

- 1 Solderless breadboard

- Jumper Wires in assorted lengths
Sketch for counting up without buttons:
Continue Reading »
Controlling a Seven-Segment Display Using Arduino Part 4
The third and final Arduino sketch uses bits to represent each segment and is a reduced code version of the previous sketch (1,210 bytes for sketch #3 instead of 1,852 bytes for sketch #2). A ten element array holds a byte for each number 0-9 that specifies what segments should be lit (pin low). Bit 0 corresponds to segment A, bit 1 to segment B and so on. In order to display the number 1, segments B and C need to be lit, so that is represented by the value 0b1111001. Function “lightSegments” reads these bits in sequence and sets the corresponding segments accordingly.










