Hi,
I have problems referring to the MCP23017 with the Adafruit-library with the Arduino pro Micro/Leonardo and Interrupts. What I already tried: The I2C-communication works fine, reading the push-button and connecting the push button directly to the interrupt pin D7 on the Arduino works. This is only a small part of a project, therefore I need the MCP.
The problem is that the Interrupt does nothing. Only if I read the push-button pin manually in the main loop the interrupt service routine gets activated. I'll send a schematic and the Code.
Could anyone give me a hint?
I think you need a pullup resistor on your digital input from your pushbutton on pin GPA7.
If reading the register allows the interrupt to work, then I suspect that an initial interrupt has already occurred and the code somehow missed it. According to the datasheet, "*The interrupt remains active until the INTCAP *or GPIO register is read". I suspect that reading the GPIO register is clearing the interrupt and therefore the interrupt starts working.
I think you need a pullup resistor on your digital input from your pushbutton on pin GPA7.
I activated the internal pullup with the command
mcp.pullUp(TASTER, HIGH);
didn't I?
If reading the register allows the interrupt to work, then I suspect that an initial interrupt has already occurred and the code somehow missed it. According to the datasheet, "*The interrupt remains active until the INTCAP *or GPIO register is read". I suspect that reading the GPIO register is clearing the interrupt and therefore the interrupt starts working.
This explenation fits exactly to the other observations I made so I think this will be the solution. I'll try it.