This block will start the execution of a coding strip the moment negative input changes to positive input
Start on condition change flow block can accept true
or false
input.
Ways to start coding strip using Start on condition change flow block:
- Press on the Start on condition change block (1)
- Press the ‘Run program’ icon in the top right corner (2)
- Navigate to the ‘App Control’ view (3)
![](http://rcbrick.com/wp-content/uploads/2024/01/execute-command-using-start-on-condition-change-1024x492.png)
When started, the coding strip with a Start on condition change block will be executed only if the has changed from false
to true
, and it will execute the coding strip once.
LEGO® Powered UP App coding example: Play sound when device orientation changes
Step 1:
- Add Flow block – Start on condition change
- Add Sound block – Whistle
- Add Math block – Output equality check
- Add Sensor block – Report control device tilt angle x-axis
Step 2: Start the coding strip. Observe that the sound is played once the left side of the device is lifted.
Note: Similar code can be created using Start on condition block, main difference would be that with Start on condition block sound would be played repeatedly.