> For the complete documentation index, see [llms.txt](https://learn.pakronics.com.au/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.pakronics.com.au/halocode-1/code-with-mu-a-simple-python-editor/examples/basic-project/make-a-volume-detector.md).

# Make a Volume Detector

Make a volume detector with HaloCode. Use the microphone of HaloCode to detect loudness and visualize the the value with the LED ring. The louder the sound is, the more LEDs will light up.

1\. Drag an Events block when button is pressed to the Scripts area.

![](/files/-Lpg6r-dfHZXCdDmSgWU)

2\. Add a Control block forever.

![](/files/-Lpg6r-ecUr5jrYNH-Ta)

3\. Add a Lighting block LED ring shows ()% and a Sensing block microphone loudness.

![](/files/-Lpg6r-fnm38VWJPceZN)

4\. Try hitting the table and check the LED ring of HaloCode.

![](/files/-Lpg6r-gPn9JWwGiER44)
