Shop OBEX P1 Docs P2 Docs Learn Events
number of — Parallax Forums

number of

ArchiverArchiver Posts: 46,084
edited 2004-02-27 14:03 in General Discussion
And let's point out to the poster what those devices are. They're
shift registers.

By using shift registers you can greatly increase the number of
inputs and outputs, because you're no longer reading the status of
one pin. You're instead shifting in/out a byte of data. The
compromise is speed and more code.

For output, you compose the byte of how you want those outputs to be
set and then shift out the data through the shift register.

For input, you shift in the data from the shift register and then
read the bit(s) by masking.

Mike


--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> Sure, there are lots of add-ons that are cheap (pennies) and easy to
> use. Want eight more outputs? Use the 74HC595 (it needs three
Stamp
> pins). Want eight more inputs? Use the 74HC165 (it also needs
three
> pins, but you can mix both chips and use just five IOs). And both
> devices can be daisy-chained for even more pins without consuming
any
> more Stamp IO.
>
> Download and have a look at our book StampWorks for code samples and
> other ideas.
>
> -- Jon Williams
> -- Parallax
Sign In or Register to comment.