I using a Node MCU V3 board carrying and ESP8266. My project requires a silly number of inputs (about 15 of them) and I have opted to expand the number using a MCP23017 on a waveshare breakout board: https://www.waveshare.com/wiki/MCP23017 ... sion_Board
I am able to read the status of each pin by polling the IC repeatedly... e.g. print(io.input_pins(inPins))
What I am unable to do is configure the IC to change status of one/both of its interrupt pins (something which the datasheet for the MCP23017 says is configurable): https://www.waveshare.com/w/upload/b/b3 ... asheet.pdf
The library I am using: https://github.com/ShrimpingIt/micropython-mcp230xx
All other functions appear to be fine.
Please assist me (new in the world of micropython) by explaining how I would configure the IC to set interrupt pins LOW when a change occurs on one of the intput pins.
For simplicity I have set the first 8 pins to inputs and the second 8 to outputs:
Code: Select all
outPins = list(range(9,16))
nextVals = {}
for pinNum in outPins:
io.setup(pinNum, mcp.OUT)
nextVals[pinNum] = True
inPins = list(range(0,8))
for pinNum in inPins:
io.setup(pinNum, mcp.IN)
io.pullup(pinNum, True)