Connected Devices: 002

My life long technology dream has come true: I made a clap-light.

Using the Philips Hue API and accessing a device’s microphone through the browser, a user can toggle a pair of Hue bulbs on and off. Using p5.js, the browser routinely polls the microphone, checking for a sound reading above 0.1. When loud enough, the page makes an AJAX call to change the on/off state. The new state is then saved so it can be toggled.

The full code is available on Github; a snippet below shows the web-interface component.