Simulation

Robot Data

Position:

Rotation:

Balloons Popped: 0

Elapsed Time: 0.00s

Python Code

Console Output


        

Command Reference

Drive Forward / Reverse

Drives for a distance in pixels.

drivetrain.drive_for(150)

Turn Right / Left

Turns a relative number of degrees.

drivetrain.turn_for(90)

Turn to Heading

Turns to an absolute heading (0-360).

drivetrain.turn_to_heading(180)

Stop Driving

Immediately stops all motor movement.

drivetrain.stop()

Set Velocity

Sets drive/turn speed (1-100%).

drivetrain.set_drive_velocity(100)

Wait / Pause

Pauses the program for seconds.

sleep(1.5)

Pen Down

Lowers the pen to start drawing.

drivetrain.pen_down()

Pen Up

Lifts the pen to stop drawing.

drivetrain.pen_up()

Get Number

Reads the number of the grid square the robot is on (only on 'Number Grid' map).

drivetrain.get_number()

Get Position

Reads the position of the robot as an array [positionX,positionY].

drivetrain.get_position()

Get Heading

Reads the heading of the robot in degrees.

drivetrain.get_heading()