Files
pybricks-api/examples/pup/remote/timeout_exception.py
T
2026-08-24 09:28:29 +02:00

16 lines
333 B
Python

from pybricks.pupdevices import Remote
try:
# Search for a remote for 5 seconds.
my_remote = Remote(timeout=5000)
print("Connected!")
# Here you can write code that uses the remote.
except OSError:
print("Could not find the remote.")
# Here you can make your robot do something
# without the remote.