m5stack / M5StickC

M5StickC Arduino Library
MIT License
477 stars 222 forks source link

M5Display.h declares a setBrightness but the method is not implemented #126

Closed IsaacG closed 3 years ago

IsaacG commented 3 years ago

https://github.com/m5stack/M5StickC/blob/master/src/M5Display.h#L34

There's a M5Display:setBrightness in the .h but not the .cpp

Is there supposed to be an implementation?

ldoyle commented 3 years ago

Indeed the function implementation seems missing. Unfortunately, it will not be easy to set an arbitrary brightness on M5StickC. According to the schematics, the backlight LED is connected directly to LDO2 of the AXP power controller. Inside AXP192.h/.cpp the function ScreenBreath does something to try and set the brightness via the LDO voltage. Due to the limit of 12, it effectively tunes the LDO voltage from 1.8V to 3.0V which will result in some brightness change, for sure. You could try and simply implement a call of AXP192's ScreenBreath inside M5Display::setBrightness and create a Pull Request?

Tinyu-Zhao commented 3 years ago

Using Axp to manage power related is the right choice, I am also on the minimum voltage