Xinyuan-LilyGO / T-Display-S3

MIT License
734 stars 174 forks source link

Screen brightness #74

Closed parahooners closed 1 year ago

parahooners commented 1 year ago

Hey - is there a simple way to adjust the screen brightness ?

teastainGit commented 1 year ago

Well...great question... Several hours later... The Schematic says that GPIO38 is ESP_LCD_BLK Which enables the clever chip "AW9364DNR" Which dims the four LCD LED backlights here:

Screenshot 2022-12-28 at 12 15 37 AM

So, using LEDC "you can indeed" control the display brightness, proven on my T-Display S3 !!! Add this code:

to declarations: const int ledPin = 38;
const int freq = 5000; const int ledChannel = 0; const int resolution = 8; To void setup: ledcSetup(ledChannel, freq, resolution); ledcAttachPin(ledPin, ledChannel); To void loop: ledcWrite(ledChannel, 25); where 25 (fairly dim) is 25 of 255 max value. Variable from 0 - 255 Cheers, Terry

svdrummer commented 1 year ago

I know that the information Terry wrote above works, as i have tried the same thing based on Terrys information.

parahooners commented 1 year ago

Well...great question... Several hours later... The Schematic says that GPIO38 is ESP_LCD_BLK Which enables the clever chip "AW9364DNR" Which dims the four LCD LED backlights here: Screenshot 2022-12-28 at 12 15 37 AM

So, using LEDC "you can indeed" control the display brightness, proven on my T-Display S3 !!! Add this code:

to declarations: const int ledPin = 38; const int freq = 5000; const int ledChannel = 0; const int resolution = 8; To void setup: ledcSetup(ledChannel, freq, resolution); ledcAttachPin(ledPin, ledChannel); To void loop: ledcWrite(ledChannel, 25); where 25 (fairly dim) is 25 of 255 max value. Variable from 0 - 255 Cheers, Terry

Thanks Terry 👍 I will give this a go