This tutorial makes use of the speaker and hardware RGB LED light to simulate the police alarm. Blue and red light, and two different tones are shown and played alternatively.
Step 1. Set the speaker volume to 1.
Step 2. Play the speaker wit 770Hz frequency with 0.7s followed by 960Hz frequency with 0.7s and loop it.
Step 3. Set the left and right RGB bar colour before playing the tone.
Step 4. Test the final code.
Step 5. Execute it and see the result.