You can set each of 16 pins to be input, output, or input with a pullup. There's even the ability to get an interrupt via an external pin when any of the inputs change so you don't have to keep polling the chip.Use this chip from 2.7-5.5V (good for any 3.3V or 5V setup)...