Книга: Advanced PIC Microcontroller Projects in C

Project Description

Project Description

This project is similar to Project 3, but here LEDs are shared, which uses fewer input/output pins.

The LEDs in Table 6.1 can be grouped as shown in Table 6.3. Looking at this table we can say that:

• D4 can appear on its own

• D2 and D6 are always together

• D1 and D3 are always together

• D5 and D7 are always together

Table 6.3: Grouping the LEDs

Required number LEDs to be turned on
1 D4
2 D2 D6
3 D2 D6 D4
4 D1 D3 D5 D7
5 D1 D3 D5 D7 D4
6 D2 D6 D1 D3 D5 D7

Thus, we can drive D4 on its own and then drive the D2, D6 pair together in series, the D1, D3 pair together in series, and also the D5, D7 pair together in series. (Actually, we could share D1, D3, D5, D7 but this would require 8 volts to drive if the LEDs are connected in series. Connecting them in parallel would call for even more current, and a driver IC would be required.) Altogether, four lines are needed to drive the seven LEDs of each dice. Thus, a pair of dice can easily be driven from an 8-bit output port.

Оглавление книги


Генерация: 0.403. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз