DebouncerPIO
A PIO library to debounce input on Raspberry Pi Pico
Install / Use
/learn @benevpi/DebouncerPIOREADME
DebouncerPIO
A PIO library to debounce input on Raspberry Pi Pico
This should trigger a callback every time a button is pressed. There are two classes: DebouncerLowPIO and DebouncerHighPIO. The former is for buttons that pull the input low and the latter is for ones that pull the input high. They're initialised with DebouncerLowPIO(statemachine, pin_number, callback). It's possible that callback will be called more than once a button press -- the debouncing isn't perfect. It can probably be optimised.
It will automatically add a pullup/down so you can just wire the button straight into the GPIO. There are also start() and stop() methods should you with to pause the state machine.
You'll need ot copy the DebouncerPIO file to your Pico, then it should work with (for example)
import DebouncerPIO
def handler(sm):
print("Here")
button = DebouncerPIO.DebouncerLowPIO(0,0,handler)
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
