scottlawsonbc / audio-reactive-led-strip

:musical_note: :rainbow: Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
MIT License
2.68k stars 644 forks source link

Immediate switch off and strobe #267

Closed knichol closed 4 years ago

knichol commented 4 years ago

Hey! I'm currently tweaking the code a bit to add more functionality to the GUI. I wanted to add an Off and a Strobe function. I have the buttons etc all hooked up and displaying correctly on the GUI. For the Off function I copied the scroll functions but just set the array values to 0 which gradually turns off the LEDs. Does anyone know how I might be able to completely switch off all the LEDs from the context of the GUI? Also I want to try build a strobe type function into the visualization.py code. I tried reworking the spectrum function to output an array of 255, 255, 255 but it didn't really work. Has anyone any ideas how I might accomplish that kind of functionality? Thanks!

not-matt commented 4 years ago

Hi, this numpy function is probably what you're looking for

https://stackoverflow.com/a/20606278

On Thu, 14 May 2020, 14:06 knichol, notifications@github.com wrote:

Hey! I'm currently tweaking the code a bit to add more functionality to the GUI. I wanted to add an Off and a Strobe function. I have the buttons etc all hooked up and displaying correctly on the GUI. For the Off function I copied the scroll functions but just set the array values to 0 which gradually turns off the LEDs. Does anyone know how I might be able to completely switch off all the LEDs from the context of the GUI? Also I want to try build a strobe type function into the visualization.py code. I tried reworking the spectrum function to output an array of 255, 255, 255 but it didn't really work. Has anyone any ideas how I might accomplish that kind of functionality? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scottlawsonbc/audio-reactive-led-strip/issues/267, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXFVTF65FHDG7ARH5WPGYDRRPUDZANCNFSM4NAVOU3A .

knichol commented 4 years ago

nailed it. got both functions working, thanks!