Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to enable interrupts #9

Open
@gregorgebhardt

Description

@gregorgebhardt

Hi,

I would like to enable interrupts on a Adafruit NeoKey 1x4 board. The NeoKey board is connected to a Raspberry Pi, the INT pin of the NeyKey board is connected to pin 16 of the RPI. Is use the following code to register a callback for the interrupts:

GPIO.setmode(GPIO.BCM)
GPIO.setup(INTRRPT_GPIO, GPIO.IN, pull_up_down=GPIO.PUD_UP)

logger.info(f"registering interrupt detection on pin {INTRRPT_GPIO}")
GPIO.add_event_detect(INTRRPT_GPIO, GPIO.FALLING, callback=on_neokey_interrupt, bouncetime=100)

where the function on_neokey_interrupt just prints some output. This is working fine, if I connect pin 16 to ground.

Using the parameter in the constructor has no effect:

self.interrupt_enabled = interrupt

This will only set the field interrupt_enabled since the property is only implemented in Keypad, not in Seesaw.

I tried the following, but also with no success:

neokeys = NeoKey1x4(board.I2C())
for k in range(4):
    neokeys.set_GPIO_interrupts(4 + k, True)

Any ideas what the problem could be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions