The MAX7219 connects to the LED displays in a straightforward way; pins SEG A through SEG G and
SEG DP connect to segments A through G and the decimal point of all of the common-cathode
displays. Pins DIGIT 0 through DIGIT 7 connect to the individual cathodes of each of the displays. If
you use less than eight digits, omit the highest digit numbers. For example, this experiment uses four
digits, numbered 0 through 3, not 4 through 7.

The MAX7219 has a scan-limit feature than limits display scanning to digits 0 through n, where n is
the highest digit number. This feature ensures that the chip doesnt waste time and duty cycles
(brightness) trying to scan digits that arent there.

When the MAX7219 is used with seven-segment displays, it can be configured to automatically
convert binary-coded decimal (BCD) values into appropriate patterns of segments. This makes the
display of decimal numbers simple. The BCD decoding feature can be disabled to display custom
patterns. This experiment does both.

From a software standpoint, driving the MAX7219 requires the controller to:

 - Shift 16 data bits out to the device, MSB first.
 - Pulse the Load line to transfer the data.

Each 16-bit data package consists of a register address followed by data to store to that register. For
example, the 16-bit value $0407 (hex) writes a '7' to the fourth digit of the display. If BCD decoding
is turned on for that digit, the numeral '7' will appear on that digit of the display. If decoding is not
turned on, three LEDs will light, corresponding to segments G, F, and E.

In this experiment, the MAX7219 is initialized to:

 - Scan = 3 (Display digits 0 -> 3)
 - Brightness = 5
 - Decode = $0F (BCD decode digits 0 -> 3)
 - Shutdown = 1 (normal operation)

Initialization of the MAX7219 is handled by a loop. Each pass through the loop reads a register
address or data value from a LOOKUP table. After each data value is shifted out, the address and data
are latched into the MAX7219 by pulsing the Load line.

Most of the work takes place in the subroutine called Show_The_Money. When the money count is
less than 9999, the value will be displayed on the seven-segment digits, otherwise the display will
read 'FULL'. The routine scans through each digit of money and sends the digit position and value
(from the DIG operator) to the MAX7219. Since the display shows dollars and cents, the decimal
point on the third digit is enabled. When the position and digit have been shifted out, the display is
updated by pulsing the Load line. To keep the display neat, the leading zero is blanked when the
money value is less than 1000.

When the value of money reaches 9999, the display will change to 'FULL'. This is accomplished by
disabling the BCD decoding of the MAX7219 and sending custom letter patterns to the MAX7219.
These patterns are stored in DATA statements.

The main loop of the program is simple: it scans the switch inputs with Get_Coins and updates the
money count for each switch pressed. This particular code is an excellent example of using variable
aliases for readability.
