It is ussually a common situation when we have used up
all our I/O on our microcontroller but we still need
to use additional I/O and what shall we do ? The
following is one solution to this problem by expanding
the number of I/O using shift register I.C like 74165
and 74595.
AVR ~US$199
68HC11 ~US$199
The following code,
exp_io_c
shows how to use the 74165.C and
74595.C libraries for extended input and output.
When button S1 is pushed, LED 1 will toggle green. Button S2 will toggle LED 2.
However, when both buttons are pushed, LED 3 will toggle green.
|