mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 09:05:07 +00:00
16 lines
333 B
Python
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.
|