echo-lalia / MicroHydra

MicroHydra is a simple, 'OS-like', MicroPython based app switcher designed for ESP32 based devices.
GNU General Public License v3.0
135 stars 14 forks source link

Add method to control display brightness from display libraries #8

Open echo-lalia opened 6 months ago

echo-lalia commented 6 months ago

A potentially useful feature would be to create a method in both st7789py and st7789fbuf, which could control the display brightness easily.

This could open the door to adding a display brightness setting to the config at a later date, as well.

echo-lalia commented 2 weeks ago

For MicroHydra 2.0 this should be even easier. We just need to remove backlight control from lib.display.st7789.py and add it to lib.display.display.py.

The Display class can take over backlight control with PWM using the device-specific backlight Pin constant.

Then we can add a method for changing the duty cycle for the PWM, probably using a float from 0.0-1.0, or maybe an integer percentage, for user-friendliness (rather than raw duty cycle values)