Hello. I’ve got the Phat Beat working fine and looking totally boss next to a microdot phat in the cyberdeck I made, but is there a way to control the color of the VU? Mine goes from Green to yellow to orange at the peaks. Is it possible to set a different color scheme?
I say there are various python commands to set the LEDs individually, but I can’t figure out to do it when it’s acting as a VU.
Thanks a lot.
If you figure that out please let me know. I want to go the other way and replicate the display on the pHat Beat on something like the LED Shim.
I know how to change the sensitivity, no idea how the colors work though?
Yeah. The sensitivity and how long the leds sustain is documented, but not the colors. I took some guesses but nothing worked. I’ll poke around some more and will post back if I make any progress, but hopefully someone at Pimoroni knows. My device has a red theme, so what I would like to do is have the VU start at deep red, go through lighter reds and maybe peak at white.
Have a look see at
src/devices/phat-beat.c
Line 88 the 131071.0f Is what I edit to change the sensitivity.
int bar = (meter_level * (meter_level / 8) / 131071.0f) * (brightness * (NUM_PIXELS/2));
The color magic is likely in that file some place too.
1 Like
Yes, thanks for the suggestion. It looks like it’s in there. If I change the initial r, g, b pixel index settings <<= from 8, 5, 5 to something else, I get all kinds of color shifts.
Right now I’m doing 5, 5, 8 which makes the leds always red and the peaks in green, which is kind of cool, but I still don’t get how it works.
Join the club, my python skills are self taught and about average. I have a bunch of projects where I used blocks of code from the examples. I know what it does, I just have no idea how it does what it does.
My pHat Beat is setup headless as a Pirate Radio. I’ll try and have a look at that file tomorrow. It’s usually something like (r, g, b) = (255, 255, 255) and each of the three values can be from 0 off, to 255 full brightness. 255, 255, 255 is white etc.
I think you already know that but I’ll mention it for anybody else reading this thread.
Thanks to your suggestion @alphanumeric my device looks like this. I don’t have time to do more, but I think eventually I’ll understand what the C code is doing if I try the various options and document what I’m doing.
I’ve got Microdot display on the right showing the time and there’s also a radiation detector and an enviro+ in there running properly but only accessible if you access the data on the command line. Eventually I’ll have the microdot rotating periodically to show time, PM2.5, temp, radiation in uSvh, etc. etc.