Defina o pino no MCP23017 usando o Shell Raspberry Pi
# for original rev1 Pi
sudo i2cset -y 0 0x20 0x00 0xff
sudo i2cset -y 0 0x20 0x14 0x01
# address register value
# for rev2 Pi or later
sudo i2cset -y 1 0x20 0x00 0xff
sudo i2cset -y 1 0x20 0x14 0x01
# address register value
Laith Striegher