The second part of the program, the control loop
BHV, has its own Start block, which allows this part of the program to run in parallel to the main programming loop. At the beginning, the
st Variable block sets the robot state to
0 or resting. The program then enters the
BHV Loop block or the robot behavior loop.
A numeric switch block examines which of the three robot states the robot is in, with 0 for resting state, 1 for waking state, and 2 for the active state. The resting state (state 0) is the default case of the switch block. In this state, the variables blocks
Cstr are set to
Cdrv variables block (Control drive) is used to control the speed at which the robot drives either forward or backwards. The ...