5. Advanced Operation

2. Police Alarm

43 views 2019-06-04 peterletintech 0

Hardware requirement

  • M5GO

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.

Was this helpful?