Using the Pen on the VR 123 Robot

The VR 123 Robot in the 123 Playspace in VEXcode VR is equipped with a VR Pen. This enables you to add color, lines, and drawings to your projects on the Field. You can adjust the Pen width and color, move the Pen up and down to draw, and fill in areas on the Field with color using the Pen.


Setting the Pen Width

VEXcode VR 123 workspace showing the 123 Robot in the Playspace and pen command blocks in the project area

The [Set pen width] block is used to adjust the width of the line drawn by the Pen on the VR 123 Robot. The default width is set to thin.

The line can be made more fine by setting the Pen width to 'extra thin', or wider by setting the Pen width to 'medium', 'wide', or 'extra wide'. 

VEXcode VR blocks to move the 123 Robot while drawing with the pen tool

This image shows an example of the difference in line thickness from 'extra thin' (at the bottom) to 'extra wide' (at the top). 

Moving the Pen

VEXcode VR 123 workspace with the 123 Robot in the Playspace and pen blocks in the project area

To draw with the Pen on the VR 123 Robot, you must move the Pen 'down' onto the Field using the [Move Pen] block. 

The default setting for the Pen is 'up', or not drawing on the Field. 

VR 123 Robot with pen lowered on the VEXcode VR 123 Playspace, ready to draw

This image shows an example where the Pen was moved between 'down' and 'up' to draw lines and leave a space between.

VEXcode VR workspace showing the 123 Robot in the Playground for testing pen commands

Moving the Pen 'down' then immediately 'up' will result in drawing a spot on the Field, as shown in this image.

Setting the Pen Color

VR 123 Robot in the VEXcode VR Playspace with the pen lowered to draw

There are two ways to adjust the Pen color. The first is using the [Set Pen color] block to set the Pen color to one of four preset basic colors – black, red, green, or blue.

The default color for the Pen on the VR 123 Robot is black.

VEXcode VR 123 workspace showing blocks used to program the robot with the pen

You can also use the [Set Pen color] block with color sliders to set the Pen color to any shade.

Move the sliders within the block to adjust the red, green, and blue values.

Move the opacity slider to adjust how solid or translucent your color appears on the Field.

VEXcode VR 123 Playspace showing the 123 Robot using pen command blocks to draw a path

As the sliders are moved, the color in the [Set Pen color] block will change to reflect that color combination.

Continue moving the sliders until your desired color is created.

VEXcode VR 123 workspace showing blocks that lower the pen and drive the 123 Robot to draw in the Playspace

In this example, the [Set Pen color] block is used to draw a multi-colored square.

Filling an Area with Color

VEXcode VR 123 workspace showing the 123 Robot in the Playspace and pen command blocks in the coding area

You can also use the Pen on the VR 123 Robot to color in an area on the Field, using the [Fill area with color] block.

Move the sliders within the block to adjust the red, green, and blue values. 

Move the opacity slider to adjust how solid or translucent your color appears on the Field.

Continue moving the sliders until your desired color is created.

VEXcode VR 123 workspace showing pen command blocks and the 123 Robot in the Playspace

In this example, the [Fill area with color] block was used to color the Field. You can also use this feature to color in shapes that you have drawn with the Pen. 

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: