34 lines
642 B
Python
Executable file
34 lines
642 B
Python
Executable file
"""
|
|
This example display a CircuitPython console and
|
|
print which button that is being pressed if any
|
|
"""
|
|
import time
|
|
from adafruit_featherwing import minitft_featherwing
|
|
|
|
minitft = minitft_featherwing.MiniTFTFeatherWing()
|
|
|
|
while True:
|
|
buttons = minitft.buttons
|
|
|
|
if buttons.right:
|
|
print("Button RIGHT!")
|
|
|
|
if buttons.down:
|
|
print("Button DOWN!")
|
|
|
|
if buttons.left:
|
|
print("Button LEFT!")
|
|
|
|
if buttons.up:
|
|
print("Button UP!")
|
|
|
|
if buttons.select:
|
|
print("Button SELECT!")
|
|
|
|
if buttons.a:
|
|
print("Button A!")
|
|
|
|
if buttons.b:
|
|
print("Button B!")
|
|
|
|
time.sleep(0.001)
|