Block Functions
Getting to know graphical blocks
Using blocks in Zenbo APP Builder
Getting to know graphical blocks
Start blocks
Layout: Blocks with top side flat and a small protruding triangle underneath.
Characteristics: No blocks are connected on the top side while other intermediate blocks may be connected in the bottom.
Function: Start.
Figure 12. Start block.
Intermediate blocks
Layout: Blocks with small triangular dent on the top side and a small protruding triangle underneath.
Characteristics: Connect other blocks on the top and bottom side.
Function: Expression, Say, etc.
Figure 13. Intermediate blocks.
Independent blocks
Layout: Blocks with both top and bottom side flat and intact.
Characteristics: No blocks are connected on the top and bottom side while more blocks may be embedded inside. These blocks are usually executed when triggered by an external event.
Function: If a face is detected, when an event is received, etc.
Figure 14. Independent blocks.
Compound blocks
Layout: Blocks with small triangular dent on the top side and a small protruding triangle underneath; more blocks may also be embedded inside.
Characteristics: More blocks may be embedded inside; similar to intermediate blocks.
Function: Repeat.
Figure 15. Compound blocks.
Variable blocks
Layout: Blocks with a small protruding trapezoid on the left side to connect other blocks.
Characteristics: Usually as blocks with variables or conditional inputs.
Function: String, Speak Volume, etc.
Figure 16. Variable blocks.
Using blocks in Zenbo APP Builder
A variety of blocks are listed here to describe their important features :
Start block
Ensure to use start block as the beginning block of a program sequence.
Move blocks (Non-Blocking/Blocking)
Blocking: Run the next command only when the action has completed.
Non-Blocking: Run the next command instantly when an action begins regardless of its completion.
Examples as shown below:
Run the head and body movement sequentially when set to blocking.
Run the head and body movement simultaneously when set to non-blocking.
Figure 17. Differences of Blocking and Non-Blocking movement.
Sensing blocks
Perform an action when an external event is triggered. When an external event is detected, the current action will be paused until the external event block is completed
FFigure 18. Sensing blocks.
Multi-media blocks (Non-Blocking/Blocking)
Blocking: Run the next command only when the music finishes playing.
Non-Blocking: Run the action in the inner block simultaneously when the music starts playing.
If the music has finished playing and the action in the inner block is not completed yet, the next command will only run when the action in the inner block has been completed.
If the music is still playing when the action in the inner block has completed, the next command will only run when the music finishes playing.
Figure 19. Multi-media blocks.
ListView blocks (ASUS CommonUI)
ListView features the following functions:
Zenbo’s voice interaction: Provide simple voice interaction as shown by ‘Which one do you like’ in Fig. 20.
Package interface: Developer can present information by defining short descriptions as shown by ‘I am eventA’ in Fig. 20.
ASUS Common Behavior: Achieve the effects of Common Behavior by setting up simple texts as shown by the Interface Tips block in Fig. 20.
With ListView activated, Zenbo will send out a voice prompt for user to issue a command. Zenbo will display the hint screen if no response is made within the 12 second lapse as shown by the Interface Tips block in Fig. 20.
Tips: Define an Interface Tips block to display a tips screen. Ensure that the tips name in the ListView and the Interface Tips is the same as shown by the red squares in Fig. 20. If no Interface Tips are defined, the ListView will exit and continue the next action if no response is made.
Countdown: Define Countdown Duration in the Interface Tips block to use a countdown. Set to 0 to disable the countdown page.
ListView options: Tap or use voice command to select an option, and the corresponding event block will run. Ensure that the name in the ListView and the event block is the same as shown by the pink squares in Fig. 20.
Figure 20. Using ListView.
Variables and logic blocks
Combine these two blocks to apply a conditional input.
Example as shown below:
Run an action when the battery power reaches a certain level, or run a task when the user speaks certain speech strings, etc.
Figure 21. Combining variables and logic blocks.