Lesson 1: Draw a Square
The move command moves the Pen tool up and down on the VR Robot. This example will have the VR Robot draw a square on the Art Canvas Playground.

- The new text project template begins with a drive_for command. Remove that command, and drag in, type or copy the move command to begin your project.
def main():
pen.move(DOWN)
For Your Information
The move command can be used to pick up and put down the Pen tool on a VR Robot.

- Drag in, type or copy the drive_for command and place it below the move command. Set the parameters of the drive_for command to drive forward 600 millimeters (mm).
def main():
pen.move(DOWN)
drivetrain.drive_for(FORWARD, 600, MM)
Your project should appear as above.
- Next, drag in, type or copy the turn_for command and place it after the drive_for command. Set the parameters of the turn_for command to turn right 90 degrees.
def main():
pen.move(DOWN)
drivetrain.drive_for(FORWARD, 600, MM)
drivetrain.turn_for(RIGHT, 90, DEGREES)
Your project should appear as above.
- To draw the second side of the square, copy the drive_for and turn_for command. To copy, highlight the drive_for and turn_for commands. Right click or long press on the commands, and Select "Copy". Then right click or long press under the commands and select "Paste."
- Additional drive_for and turn_for commands are now added to the stack. This creates the first two sides of the square.
- To draw the last two sides of the square, copy the drive_for and turn_for commands. Highlight all four commands, then right click or long press, and Select "Copy." Right click or long press under the highlighted commands and select "Paste."
- The commands will then be duplicated and create the last two sides of the square.
- Select the “Open Playground” button to open the Playground Window, if it is not already open.
- Be sure the Art Canvas Playground opens.
- Select the “Start” button to test the project.
- The VR Robot will drive forward for 600 millimeters (mm) and then turn right for 90 degrees, while drawing with the Pen tool. The VR Robot will repeat these behaviors four times to draw all four sides of the square.
- Select the “Reset” button to reset the Playground and move the VR Robot back to the starting position.
For Your Information
The set_pen_color command can be used to change the colors of the pen. The pen can be set to one of four colors: Black, Blue, Green, or Red.

Select the Next button to continue with the rest of this Lesson.