rpi-ws281x / rpi-ws281x-python

Python library wrapping for the rpi-ws281x library
BSD 2-Clause "Simplified" License
326 stars 103 forks source link

Pulse brightness up and down? #39

Closed emdeex closed 1 year ago

emdeex commented 4 years ago

I see the overall strip brightness is set as one-time variable.

LED_BRIGHTNESS = 255 # Set to 0 for darkest and 255 for brightest

Can I use a function like 'rainbowCycle' and have it run through brightness from 0 to 255 over an interval and reverse and repeat? Possible?

jwnicholas99 commented 4 years ago

Yep I'm pretty sure you can - in library/rpi_ws281x/rpi_ws281x.py, there is a PixelStrip class method called setBrightness() that will allow you to modify the brightness of the LED strip.