Adafruit_Learning_System_Gu.../Keypad_Examples/one_button/code.py
2022-06-14 14:23:54 -04:00

14 lines
326 B
Python

# SPDX-FileCopyrightText: 2022 Dan Halbert for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import board
import keypad
keys = keypad.Keys((board.D5,), value_when_pressed=False, pull=True)
while True:
event = keys.events.get()
# event will be None if nothing has happened.
if event:
print(event)