Stepping Through a Project with the Coder

Normally, when a Coder project is running, it moves on from one card to the next as soon as that action is completed. Using the Step feature, you can start a project, but in a special mode where you control the flow. When using the Step button, the 123 Robot will pause after each Coder card, until the Step button is pressed again. When a project is started, the 123 Robot will perform the project as instructed, but it may not be how the user intended. Having the ability to see the cards being executed one at a time gives the user a better visual of which cards may be causing the error, so debugging can become a more targeted and efficient process.


How to Use the Step Feature

In order to use the Step feature, the 123 Robot must be connected to your Coder. For information on connecting a 123 Robot and Coder, see the Using the VEX Coder VEX Library article.

Coder with a When start 123 card in the top slot and the Step button highlighted.

Before using the Step feature, create a project in the Coder. Then, select the Step button at the top of the Coder to begin.

Coder with a project that consists of 3 cards and reads When start 123, drive 2 and then turn left. The yellow step indicator is at the When start 123 card.

Once selected, a yellow indicator light will appear next to the “When start 123” Coder card to indicate where the project is beginning.

Coder with a project that consists of 3 cards and reads When start 123, drive 2 and then turn left. The yellow step indicator is at the Drive 2 card.

Press the Step button again and the yellow light will move down to the next card in the Coder.

Coder with a project that consists of 3 cards and reads When start 123, drive 2 and then turn left. The step indicator is at the Drive 2 card and has turned green.

Select the Step button again to start the Coder card next to the yellow light. The light will turn green as the Coder card is executed.

Coder with a project that consists of 3 cards and reads When start 123, drive 2 and then turn left. The yellow step indicator is at the Turn left card.

Once the behavior is complete, a yellow light will appear next to the following Coder card, indicating that it is ready to run the next command when the Step button is selected again.

Watch this video to see the Step feature being used to step through the project one card at a time.

When stepping through a project, selecting the Start button will cause the rest of the project to execute at full speed. This can be helpful if you want to step through the first few Coder cards, but then carry out the rest of the project as it is written.


Debugging with the Step Feature

The Step feature slows down the flow of the project and provides direct visual feedback on what the 123 Robot is doing at each Coder card in the project. This allows the user to go through the project one Coder card at a time to observe behaviors and correct mistakes.

Coder with a project that consists of 9 cards used to drive the robot in a square. The project has 4 repeating pairs of Drive 1 and Turn, but one of the pairs is Turn left instead of Turn right. The incorrect Turn left card is highlighted.

In this example, the intention is for the 123 Robot to drive in a square (drive forward for 1 step and turn right, 4 times to create a square). However, there is a wrong turn in the project.

Top down view of the path the 123 Robot would take while running this project. The left turn drives the robot off of the course of the square.

Use the Project Stepping feature to start and execute the project step by step until a mistake is observed.

Coder project to drive the robot in a square, now with the Turn left card fixed by replacing it with a Turn right card.

Correct the mistake.

Top down view of the 123 Robot's path having successfully driven in a square, and the matching Coder program containing 4 pairs of Drive 1 and Turn right cards.

Then, select the Stop button and use the Step button to start the project again from the beginning, using the Step feature to observe the behavior of the 123 Robot with each Coder card of the project.

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

Last Updated: