This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Button
alienzhangyw edited this page Apr 25, 2020
·
2 revisions
Buttons are digital input devices. BlockPi support many different button to be used as input signal. I use button modules like these:
Connect the OUT pin to a GPIO port, VCC to 3.3V, GND to GND.
You'd better test and verify the input value with this code before using the botton(or any other input device):
The botton module I use returns 1 when not pressed, 0 when pressed.
The 'repeat until' part is jitters elimination, makes sure that one press one count.
Use list to control multiple LEDs:
It works like this: