Project 3 – Counting Button Presses
The project in this chapter will count button presses and display the count in a human-readable form using the seven-segment display.
Introducing the seven-segment display
In the previous chapters, we displayed binary numbers by using the LEDs on the board. You might have wondered why we weren’t using the row of unlit 8s. The reason is that there is timing associated with the display that we need registers to accomplish.
Let’s look at how we light up the seven segments. The following diagram shows which segment is controlled by which cathode:
Figure 4.13: Mapping of the seven segment display
Looking at the preceding diagram, we can see there are eight signals that define whether a given LED is lit or not. To compose a numerical image, we simply need to come up with a module that takes in a Binary-Coded Decimal (BCD) or hexadecimal number and converts it to a format that the display can handle. We have...