Start when the flag is triggered flow block

This block will start the execution of a coding strip when a flag with the same address is triggered.

Start when the flag is triggered can accept a number. Numbers can range from -9999 to 9999.

Ways to start coding strip using Start on condition change flow block:

  • Press on the Start block (1)
  • Press on the  Start when the flag is triggered  block (2)
  • Press the ‘Run program’ icon in the top right corner (3)
  • Navigate to the ‘App Control’ view (4)

When started, the coding strip with a Start when the flag is triggered block will be executed only when the flag with the same address is triggered and it will execute the coding strip once.

When started, the coding strip with a Start when the flag is triggered will be executed whenever Trigger the flag block with the same address is run.

In this example, Start when the flag is triggered will run every time Trigger the flag is run. This will result in sound played 3 times.

LEGO® Powered UP App coding example: Run multiple coding strips based on one trigger

Step 1: Add coding blocks

  • Flow block – Start + Flow block – Trigger the flag
  • Flow block – Start when the flag is triggered + Sound and light Play from the whistle sound library
  • Flow block – Start when the flag is triggered + Sound and light Set light (optional, this command will only work if  LEGO® 88005 Powered Up Light is connected to Hub)
  • Flow block – Start when the flag is triggered + Sound and light Set LED color from the list

Step 2: Run the program. Observe that sound, LED light and Hub LED coding strips were executed at the same time.

Start when the flag is triggered shines the most when used together with nested conditions and loops. It helps to de-clutter coding strips, making them more readable.

Back to Flow blocks page