mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
17 lines
334 B
Python
17 lines
334 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.
|