That one works, thanks a lot!
Really confusing that there is a PWM backlight LED mentioned in the library which does not work. And that the usage of SetLcdVoltage is inconsistent between the Core2 and TOUGH.
On Core2 the LcdVoltage changes DCDC3 (
@param number 0=DCDC1 / 1=DCDC2 / 2=DCDC3 ) which is connected to LCD_BL. For the TOUGH on the other hand DCDC3 is unused and they used the LDO3.
So maybe they should simply change the line
SetDCVoltage(2, voltage); to
M5.Axp.SetLDOVoltage(3,voltage); or maybe even better introduce a new function
SetLCDBacklightVoltage(...) in their library.
Thanks to all for your hints.