Convert orgmode README to Markdown
Update bit-rotted comment
Create a separate Makefile target for tests
traffic-lights is an Arduino sketch that runs traffic light LEDs based on noise level, calibrated against the background noise present at startup.
It's my first Arduino project, and has been a lot of fun (and quite educational).
I built this with an Arduino Uno, case, sound sensor module, and traffic light module. I used double-sided adhesive foam squares, cut to size, to mount the modules to the front of the case, and in turn, to mount the case to the wall.
Quite simply :)
At startup, it spends some time polling the microphone to work out what a 'normal' level of background noise is - calculating the mean and standard deviation. While it's doing this, it ripples the traffic light LEDs, to make it apparent to the user that it's doing something (i.e. not wedged).
In the main loop, it compares the current noise level to the mean, and triggers the lights accordingly (yellow for 3 standard deviations, red for 6).
This is an improvement on my naive first effort, which used absolute values, and had to be reprogrammed for new environments.
make clean all upload
make run_tests
traffic-lights is licensed under the GNU Lesser General Public License.
The GPL is specifically designed to reduce the usefulness of GPL-licensed code to closed-source, proprietary software. The BSD license (and similar) do not mandate code-sharing if the BSD-licensed code is modified by licensees. The LGPL achieves the best of both worlds: an LGPL-licensed library can be incorporated within closed-source proprietary code, and yet those using an LGPL-licensed library are required to release source code to that library if they change it.
Thanks to Twitter Emoji for the traffic lights icon.