Files
pybricks-api/examples/pup/remote/basics.py
T
Laurens Valk d00bf35c66 all: ruff check --fix.
Mainly fixes and sorts imports.
2026-08-25 12:22:28 +02:00

21 lines
471 B
Python

from pybricks.parameters import Button
from pybricks.pupdevices import Remote
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)