- Adding actions to the canvas
- Making a sequence
- Combining actions
- Making a loop
- Moving a Start Point
- Adding triggers
- IF-ELSE statement
- Combining triggers
To follow through this tutorial, build your Robo in this configuration:
1. Adding actions to the canvas
As you connect the blocks, the corresponding functions will appear in the dock. The Dock has 5 different categories of coding elements (Sounds, Lights, Movements, Specials, and Triggers) with the colors matching the physical modules.
Drag the Blink action to the canvas and press Play.
The Blink action will be performed. Tap on the action to adjust it. Play with the setting and see how the performance is changing.
To delete the action, tap on the Trash Bin to activate the Delete Mode, then tap on the element you want to delete. Or drag the Action to the Trash Bin.
2. Making a sequence
To make a sequence, add two more Light actions to the canvas. Set each of the Lights to different colors.
Press the Connect Button to activate the connection mode and draw a line from the first action to the last. Tap anywhere on the canvas to deactivate the connection mode. Press play to start the program.
To delete the connection, activate the Delete Mode, then tap on the connection you want to delete.
Try connecting the actions in a different order.
3. Combining actions
To execute multiple actions at the same time, drop one on top of another. Add the sound to one of the light actions. Press play and test the program. You can combine up to 5 actions in one state.
PLEASE NOTE: It’s not possible to combine actions that use the same module into one state.
4. Making a loop
To make an infinite loop, connect the last state to the first so that it forms a continuous flow.
5. Moving a Start Point
You can place the Start Point on any of the States. Just grab the Start Indicator and place it on top of another State.
6. Adding triggers
You can control the transition between different states using triggers. Place the button trigger on top of each transition. In this case, the transition will happen only when the trigger conditions are met.
The triggers can be adjusted as well. Play around with the settings and see how they change the program.
7. IF-ELSE statement
You can set up an IF-ELSE statement by creating two outgoing connections and having a trigger condition on one of them. In this case, if the specified condition is TRUE, then one block of code will be executed, if it’s FALSE, the other one will.
8. Combining triggers
You can combine two triggers using AND/OR logic.
Add the distance sensor to your build. Place the Distance trigger on top of a Button trigger.
If two triggers are placed in the AND mode, both of them need to occur for the transition to happen.
If two triggers are placed in the OR mode, only one of them needs to occur for the transition to happen.
You can also look up the explanations for each symbol in the Help (?) section of the app