Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
keypad simple test by @FoamyGuy found on adafruit Discord 23/07/2021
from keypad import Keys
import board
import time
pins = [board.BUTTON_A, board.BUTTON_B]
keys = Keys(pins, value_when_pressed=False, pull=True)
while True:
if keys.events.overflowed:
keys.events.clear()
event = keys.events.get()
if event:
if event.pressed:
print("{} was pressed".format(event.key_number))
if event.released:
print("{} was released".format(event.key_number))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment