Reacting to Sound Levels
This example demonstrates how to make the a fable dongle change color depending on the sound level measured. A high sound will make it turn red, low sound level will make it turn green.
The program checks in an infinite loop if the sound level measured is above 10 (good selection of threashold will vary). If the sound level is higher than 10 it will turn the dongle light red and else it will turn green. At the same time the program also creates a graph of the sound level measured.
Example graph with a high sound around 3 seconds after the program is started.
Press the red stop button to terminate the program.
Get blockly source code here.