-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I am trying to add an interrupt to pin 0 on the chip and then on my pi pin 16 listens for the interrupt from one of the interrupt pins on the chip. I think I am close. Right now I can see the button presses but no interrupts fire.
from mcp230xx import MCP230XX
import time, os
import RPi.GPIO as IO
IO.setmode(IO.BCM)
IO.setup(21, IO.IN, pull_up_down=IO.PUD_UP)
MCP = MCP230XX('MCP23017', 0x27, '16bit')
MCP.set_mode(0, 'input', 'enable')
MCP.interrupt_options(outputType = 'activehigh', bankControl = 'both')
def functA():
print('abc')
def functB():
print('efg')
MCP.add_interrupt(0, callbackFunctLow=functA, callbackFunctHigh=functB)
IO.add_event_detect(16, IO.FALLING, callback = MCP.callbackBoth)
while True:
print(MCP.input(0))
time.sleep(.2)
Metadata
Metadata
Assignees
Labels
No labels