| Read port 2 input register |
Read the states of the pushbuttons |
0x40 |
0x01 |
| Write configuration registers to port 1 |
Configure the I/O direction for port 1 |
0x40 |
0x06 |
| Write configuration registers to port 2 |
Configure port 2 GPIOs 8 and 9 as input ports |
0x40 |
0x07 |
| Write output port register to port 1 |
Turn LED lights on or off |
0x40 |
0x02 |