Depending on how fast you need to control and respond to the GPIO, it may be easier to
use the I2C bus and control some GPIO expanders.
A chip like the PCA9555 will get you 16 each GPIO, and you can control 8 of them on an I2C bus.
If you need more GPIO than that, you can buy other parts that occupy different I2C addresses and
put another 8 times 16 GPIO on the bus.
This also adds a layer of isolation between the BBB and the GPIO. The GPIO pins on the
expanders are more rugged than the GPIO pins on the BBB, and a Voltage spike would kill
the cheap expander IC, and generally, not the more expensive BBB.
Depending on how you organize things, using the I2C bus approach will add several milliseconds to
respond to, or command the GPIO. On the other hand, you are running under Linux, which has it's
own delays and jitter that can be greater than that.
So, how many do you need? and what are your timing requirements for sensing the state of a pin
or commanding an output on the pin?
--- Graham
==