and it indeed turns the backlight off when i turn this switch off on the devices web portal… and only does that while the switch is on… i can still use the touchscreen and control things, but when i turn the switch off to turn the lcd back on it resets the device? im on the right track cos when i do the same thing with pin 1 on the 422g i get error messages about the touchscreen chip not responding and exio1 is listed as tp rst… so is pin 2 supposed to be the backlight control or not? on the wiki they show a code snippet that seems to use an lvgl function? should i be defining the backlight in the display section??? im kinda nooby to all this stuff too
That pin does control the backlight, but also the display enable itself, so it’s not really useful for turning off the backlight. I’d suggest you set it as the enable pin in the display config:
hmm that link doesnt work for me… and i prefer to use forums anyway… discord is a blight on knowledge and is literally the biggest hurdle to internet archiving today… im just astounded that the docs tell us to use the io expander to control the backlight and that makes it reset?.. like i get that you said its also connected to display enable… but i dont see why that should reset the esp
If however your real question is “Am I doing something wrong that makes it reset” then the answer AFAIK is no, you are not. That’s just what it appears to do if you mess with the DISP control, so the only solution is “Don’t do that”.
Just tried that, and for me it seems to work pretty well. I don’t need dimming, and disabling the Display might have another advantage, as the Display itself also turns off and no wear leveling is needed. If you turn the Backlight back on the display itself does a reinitialisation and redraw automagically, which is exactly what I want.
You can also get rid of that inversion if you set the restore mode to always on. ( seems that on initial boot it needs a certain state, otherwise changing the backlight only works for one time, then stays on or off.)