Tested on:RPi3, RPi0; Raspbian Stretch; Python2
Prerequisites:Raspberry Pi with Raspbian Jessie and internet connection (see steps 1-7 in the Introduction)
Hardware:UnicornHAT hd
Active speakers
(USB sound card - RPi0 only)
0

A simple equalizer for the UnicornHAT with LightShowPi


LightShowPi is a wonderful software for setting up and controlling light shows. In the last tutorial, i set up a very simple equalizer with a plain RGB LED strip. Here, Pimoroni’s UnicornHAThd is used as a display for the lightshow generated by LightShowPi: every quadrant of the HAT with its 16*16 RGB LEDs is responsible for a different frequency range of the audio signal.

Installation
First, follow the steps described in the section Installation of the tutorial First steps with LightShowPi for installing LightShowPi.
Then, install the UnicornHAT and the equalizer script by entering

After rebooting, open the configuration file defaults.cfg with

and replace the line beginning with

by

Equalizing
Enter

Hack
For applying the equalizer functionality of LightShowPi to the UnicornHAT as effortless as possible, the script ~/lightshowpi/py/synchronized_lights.py was modified for directly accessing the UnicornHAT LEDs. For this, the function update_lights(...) is intercepted: instead of applying the brightness values generated for every color channel to the pins, they are stored for coloring the quadrants later.

Now, the code just iterates over allthe 16*16 LEDs of the UnicornHAT and assigns the stored color to each quadrant.

Links
LightshowPi Installer: http://lightshowpi.org/download-and-install/
LightShowPi Homepage: http://lightshowpi.org
First steps with LightShowPi: http://www.knight-of-pi.org/first-steps-with-lightshowpi-equalizer-effect-for-rgb-led-strips/
Tutorial UnicornHAT: http://www.knight-of-pi.org/first-experiments-with-the-unicornhat/

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.

Comment

Time limit is exhausted. Please reload CAPTCHA.