adafruit / adafruit/Adafruit_CircuitPython_NeoKey

How to enable interrupts

Open
#9 1 comment 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Python
Stars
4
Forks
5
PR merge metrics
No merged PRs in 30d

Description

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:
https://github.com/adafruit/Adafruit_CircuitPython_NeoKey/blob/56d3cc2635a3604d9a4bd19a32d9ffc9f106ccfd/adafruit_neokey/neokey1x4.py#L58

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.