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
The following code,
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.