I am trying to utilize the Interrupt pin on the NeoKey1x4 to trigger a Raspberry Pi input, but it stays HIGH whenever I press one of the four keys. The documentation states the NeoKey1x4 Interrupt Pin should go LOW when a key is pressed.
I am using the following declaration in my python code to enable the NeoKey to see if it will enable the interrupt pin on the NeoKey to change state on a key press but still no joy.
neokey = Neokey1x4(i2c_bus, interrupt= True, addr=0x30)
I have tried two NeoKey1x4 boards, and both have the same result.
Do you have any ideas on what to check next?
NeoKey1x4 Interrupt
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15659
- Joined: Tue Oct 20, 2015 3:22 pm
Re: NeoKey1x4 Interrupt
From reading through the relevant bits of code, the interrupt= True argument seems to do nothing. NeoPixel1x4 is based on the Seesaw hardware/code so I would try using the SeeSaw GPIO interrupt support. See https://learn.adafruit.com/adafruit-see ... akout/gpio and the following methods that are in the SeeSaw module (which is the base for the NeoKey1x4 module.
Dave
Code: Select all
def set_GPIO_interrupts(self, pins, enabled):
"""Enable or disable the GPIO interrupt"""
cmd = struct.pack(">I", pins)
if enabled:
self.write(_GPIO_BASE, _GPIO_INTENSET, cmd)
else:
self.write(_GPIO_BASE, _GPIO_INTENCLR, cmd)
def get_GPIO_interrupt_flag(self, delay=0.008):
"""Read and clear GPIO interrupts that have fired"""
buf = bytearray(4)
self.read(_GPIO_BASE, _GPIO_INTFLAG, buf, delay=delay)
return struct.unpack(">I", buf)[0]
Please be positive and constructive with your questions and comments.