Welcome to BRICKS.
This tutorial covers the third step in working with Generators: event flow control. By completing this chapter, you will easily master the fundamental use of Generators in the BRICKS Cloud Intelligent Display.
π Estimated time to complete this tutorial: 1β2 minutes
In this section, you will learn how to directly connect the countdown Generator to the audio playback Generators, creating a smoother process for playing sounds during and after the countdown. In earlier lessons, we set events on the text element that changed with the countdown. However, if the reset functionality is triggered, the sound may play unintentionally. A better approach is to bind the audio playback directly to the countdown Generator itself.
Step 1: Remove Events from the Text Element
First, remove the Before Value Change and On Press events from the countdown text element.
Click [ X ] to delete the audio playback actions.
Step 2: Configure Events in the Countdown Generator
Locate the countdown Generator you created in the first lesson of this chapter. In the Events section on the right, find the Ticking and Completed events.
Ticking: Triggered at each countdown tick. Use this event to play the ticking sound.
Completed: Triggered when the countdown ends. Use this event to play the completion sound.
Step 3: Assign the Corresponding Audio Generators
Link the Ticking event to the SoundPlayer Generator with the ticking sound, and link the Completed event to the SoundPlayer Generator with the completion sound.
Step 4: Preview on Device
After completing the setup, save the application and preview it on a device. Check whether the ticking sound plays correctly during the countdown and whether the completion sound plays at the end.
βTip: If the ticking audio file is too long, it may overlap when triggered repeatedly. It is recommended that the audio file length matches the Interval value configured in the countdown Generator.
Congratulations! You have now learned the basic concepts of event flow control.
The next lesson will introduce multi-mode trigger combinations.
For any assistance, please click the chat icon in the bottom-right corner. Our team will respond to your questions as quickly as possible.