My first post here, and I am a bit stuck as a quite new programmer in Micropython
I am using a MCP23008 hooked up to a ESP-12F (8266) small blue board.
I have this lib MCP installed
https://github.com/ShrimpingIt/micropython-mcp230xx
Everything is working OK in the examples as this
Code: Select all
io = mcp.MCP23008()
# controls some output pins
outPins = list(range(0,7))
nextVals = {}
for pinNum in outPins:
io.setup(pinNum, mcp.OUT)
nextVals[pinNum] = True
io.output_pins(nextVals)
What I want to do is write to the OLAT or GPIO register with a whole byte like io.output_pins(5) to set pin 3 and 1 at once.
There is another def write_gpio() that seems to be able to write to the gpio register, but that is not working either. I can not
for example write io.write_gpio(5) gives an TypeError: object with buffer protocol required
What am I missing ?