dustin programming BB8
unknown
javascript
10 months ago
499 B
9
Indexable
import asyncio
from sphero_sdk import SpheroRvrAsync, SerialAsyncDal
async def main():
rvr = SpheroRvrAsync( dal=SerialAsyncDal( loop=asyncio.get_running_loop() ) )
await rvr.wake()
await asyncio.sleep(2) # Wait for BB-8 to wake up
# Move forward
await rvr.drive_with_heading(speed=50, heading=0)
await asyncio.sleep(2) # Move for 2 seconds
# Stop
await rvr.drive_with_heading(speed=0, heading=0)
await rvr.close()
# Run the event loop
asyncio.run(main())Editor is loading...
Leave a Comment