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.
The following article will cover:
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 Knowledge Base article.
Before using the Step feature, create a project in the Coder. Then, select the Step button at the top of the Coder to begin.
Once selected, a yellow indicator light will appear next to the “When start 123” Coder card to indicate where the project is beginning.
Press the Step button again and the yellow light will move down to the next card in the Coder.
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.
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 all of the steps for how to use the Step feature in action.
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.
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.
Use the Project Stepping feature to start and execute the project step by step until a mistake is observed.
Correct the mistake.
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.