seanosteen / CheerClock

Pimoroni Galactic Unicorn, Raspberry Pi Pico W, Micropython, NTP Clock with Cheerlights colored background
MIT License
19 stars 4 forks source link

Feature Request: Brightness Adjust with Lux Buttons #1

Open webwidget22 opened 1 year ago

webwidget22 commented 1 year ago

Thanks for this great project.

Would there be a way to add code to adjust the overall brightness of the display using the Lux buttons?

There is code in the Pimoroni examples that looks like this:

setup()

gu.set_brightness(0.5)

while True:

if gu.is_pressed(GalacticUnicorn.SWITCH_BRIGHTNESS_UP):
    gu.adjust_brightness(+0.01)

if gu.is_pressed(GalacticUnicorn.SWITCH_BRIGHTNESS_DOWN):
    gu.adjust_brightness(-0.01)

start = time.ticks_ms()

draw()
update()

But I'm not smart enough to know how to implement it within your project.

Thanks in advance!

seanosteen commented 1 year ago

That's a great idea. And the brightness controls are well documented in the Pimoroni example code. I'll keep this in mind if I revisit this project for future revisions. Thank you!