Files
pybricks-api/examples/pup/remote/basics.py
T
2021-06-30 17:14:25 +02:00

21 lines
471 B
Python

from pybricks.pupdevices import Remote
from pybricks.parameters import Button
from pybricks.tools import wait
# Connect to the remote.
my_remote = Remote()
while True:
# Check which buttons are pressed.
pressed = my_remote.buttons.pressed()
# Show the result.
print("pressed:", pressed)
# Check a specific button.
if Button.CENTER in pressed:
print("You pressed the center button!")
# Wait so we can see the result.
wait(100)