The following two lines are required to complete initialisation of the kit:
from sbot import Robot r = Robot()
Once this has been done, this
Robot object can be used to control
the robot’s functions.
The remainder of the tutorials pages will assume your
is defined as
Running your code¶
Your code needs to be put on a USB drive in a file called
On insertion into the robot, this file will be executed. The file is
directly executed off your USB drive, with your drive as the working
To stop your code running, you can just remove the USB drive. This will also stop the motors and any other peripherals connected to the kit.
You can then reinsert the USB drive into the robot and it will run your
main.py again (from the start). This allows you to make changes and
test them quickly.
If this file is missing or incorrectly named, your robot won’t do anything. No log file will be created.
A log file is saved on the USB drive so you can see what your robot did,
what it didn’t do, and any errors it raised. The file is saved to
log.txt in the top-level directory of the USB drive.
The previous log file is deleted at the start of each run, so copy it elsewhere if you need to keep hold of it!
All kit boards have a serial number, unique to that specific board,
which can be read using the
r.power_board.serial >>> 'SRO-AA2-7XS' r.servo_board.serial >>> 'SRO-AA4-LG2' r.motor_board.serial >>> 'SRO-AAO-RV2'