This block will start the execution of a coding strip the moment it receives a positive input.
Start on condition flow block can accept true
or false
input.
Ways to start coding strip using Start on condition flow block:
- Press on the Start on condition block (1)
- Press the ‘Run program’ icon in the top right corner (2)
- Navigate to the ‘App Control’ view (3)
When started, the coding strip with a Start on condition block will be executed only if the input is true
, and it will repeat running the coding strip as long as the input flag is true.
LEGO® Powered UP App coding example: Play sound on button press
Step 1: Add a Button widget to the Start on condition block, add Sound block
Step 2: In the Application control view, select the Button.
Make sure that the Canvas Button address is the same as the Button widget address (in this example it is 0)
Step 3: Exit edit Application control view and press the button. You should hear a sound signal on each button press.