If you have less I/O pins than you need, it's not a problem to add more thanks to this module. All you need is this module. This module expands the number of I/O pins by 16. And because it communicates over the I2C bus, it only takes up 2 I/O pins.
The device is equipped with a 16-bit quasi bidirectional I/O port (P07-P00, P17-P10), including high current latch outputs to drive the LEDs directly. Each quasi-bidirectional I/O can be used as input or output without using a data direction signal.
With adjustable three-bit addressing, it should be no problem to connect up to 8 such circuits together
The module contains 3x jumper pairs and allows to change the address, for more info see datasheet R1, R2 and R3 are pull-up resistors.