This block will stop all instructions
LEGO® Powered UP App coding example: Stop all coding strips on the button press
Step 1: Add coding blocks
Coding strip a
- Flow block – Start
- Widget block – Button widget
- Flow block – Stop instructions
Coding strip b
- Flow block – Start
- Flow block – Repeat instructions infinitely
- Sound and light block – Play from the whistle sound library
Coding strip c
- Flow block – Start
- Flow block – Repeat instructions infinitely
- Sound and light block – Play from the laser sound library
Step 2:
- Navigate to the Application control view
- Observe that when the program starts, sounds from the laser and whistle sound libraries are played simultaneously
- Press the Canvas Button (Button widget output value is true when the button is pressed)
- Observe that after pressing the Canvas Button no sounds are played