Neopixel brightness?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Strik3r
Posts: 14
Joined: Thu Nov 28, 2019 7:36 pm
Location: Saratov, Russia

Neopixel brightness?

Post by Strik3r » Sat Feb 08, 2020 2:24 pm

Is there any way to control brightness of ledlights with oficial neopixel driver? Or mb some forks of it exists (besides LoBoris port)?
Thanks

Strik3r
Posts: 14
Joined: Thu Nov 28, 2019 7:36 pm
Location: Saratov, Russia

Re: Neopixel brightness?

Post by Strik3r » Sat Feb 08, 2020 8:47 pm

Is it the right way, to change just brighness, but not colour:

Code: Select all

color = [128, 255, 128]
brightness = 5  # brighness in % (0-100)


def bri(pos):
    global brightness
    pos = round(pos/100*brightness)
    return pos


result = list(map(bri, color))
print(result)

Post Reply