Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5923

General • Re: Toggle switch to act as a single button press - HID

$
0
0
You can wire a slide switch or toggle switch to a single GP input with pull-up enabled ...

Code:

    |_    | |   _| |-o     .---> GPn  | | |-o )---'  |_| |-o )---.    |_|       `---> 0V / GND    |
When the pin changes from being high to low it can send one command, when changing from low to high it can send another.
Smart idea, thanks. Could I then use micropython for the HID part? Could you possibly direct me to some documentation which could help me with programming this? Thanks!
You could start here:
https://docs.micropython.org/en/latest/ ... B_HID.html

Or you could just implement an entire keyboard:
https://github.com/zli117/PicoMK

QMK on an Arduino might be a viable alternative.

Statistics: Posted by ame — Sun Mar 24, 2024 10:11 pm



Viewing all articles
Browse latest Browse all 5923