Getting Started¶
From an assembled BugBot to your first program in a few minutes. Nothing to install: the IDE runs in the browser and talks to the robot over USB.
No robot yet?
Skip to the Simulator. Everything in the lessons works there too.
What you need¶
- An assembled BugBot with a charged battery
- A USB-C cable
- Chrome or Edge (they support WebSerial, which the IDE uses to talk to the robot)
Step 1: open the IDE¶
Open the BugBot IDE. The editor is on the left, the 3D view on the right.
Step 2: connect the robot¶
- Plug the robot into your computer with the USB-C cable and switch it on.
- Press Connect and pick the BugBot port in the browser's dialog.
- If the robot's firmware is older than the IDE, it offers to update it. Say yes.
The status shows Connected when the robot answers.
Step 3: your first program¶
Paste this into the editor:
import bugbot; bugbot.go() # always the first line
led("green")
forward(50) # start driving at half speed
wait(1.5) # keep going for 1.5 seconds
stop()
led("off")
print("done")
Press Run on robot. The LED turns green, the robot drives for a second and a half, stops, and done appears in the console. Press Run in sim to see the same program in the 3D view.
How it works
bugbot.go() is the first line of every program. It makes forward, stop, distance and the rest available without a prefix. The program runs on the robot, so sensor readings are instant.
Running without a cable¶
Once a program is on the robot you can unplug it and press the button to run it again. To send new programs without the cable, use the dongle and the Python Library.
Troubleshooting¶
No port appears when I press Connect. Check the cable carries data (some only charge) and the robot is switched on. On Windows the robot shows in Device Manager under Ports.
The robot moves but not straight. That is normal for a vibration drive; the sensors correct it when you use forward(speed, distance=...) and turn(), which close the loop. Plain forward(speed) is open loop.
The battery light is red. Charge it over USB-C. The robot will not drive below 3.2 V.
What's next¶
- Lessons, starting with your first move
- API Reference for every function