adafruit / adafruit/node_mpr121
Add onHold Method
- Dominant language
- JavaScript
- Stars
- 11
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
it would be useful to have a way to watch for single or multiple buttons being held for a specific timeout. the use case would be something like a power off button that is activated when one or more buttons are held for a few seconds.
``` js
// single button
mpr121.onHold(2, 3000, () => console.log('pin 2 was pressed for 3 seconds'));
// multiple buttons
mpr121.onHold([2, 3], 3000, () => console.log('pins 2 & 3 were pressed for 3 seconds'));
```
Contributor guide
No contributing guide indexed for this repository
Research direction
No implementation files or tests are named. Start by inspecting the repository's existing button and event APIs, then determine how single-button and multi-button hold detection should behave around the requested timeout. Done means exposing the proposed onHold calls and verifying both use cases with tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100