As we have
mentioned earlier, a state is required when we set the statement as the
non-interrupt type. The non-interrupt statement will only exit its loop when
the exit state is true. The state Manager is used to create a state and set the
condition associated with the state. Here is the procedure:
1.
Click on the “State Manager”;
2.
Double click to
add a new state
3.
Assign the state name. The new state name can only contain ‘a ~ z’, ‘A ~
Z’, and ‘0 ~ 9’. No space is allowed.
4.
Click on “OK” to confirm.
Fig. 8-18: Add a new state in state manager
For example, we enter a new state name “Found”.
5.
Assign conditions
v Distance between the front obstacle and the
front ultrasonic sensor is in between 10 – 50 cm
v The left colour sensor has detected RED
colour (The red value of the left colour sensor is >200)
6.
Click on “Save” button to save the state and exit from the State Manager
Fig. 8-19:
Add a new state
Related Topics