HX8357D Backlight

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
adamr1
 
Posts: 120
Joined: Sun Jun 02, 2013 8:24 am

HX8357D Backlight

Post by adamr1 »

Hello. I am using the HX8357D 3.5" TFT. I am having trouble using the lite pin. What I am trying to do is have the screen light turn off after inactivity (screen not pressed). My code works, and I am using a digitalWrite LOW to disable the backlight but when I turn it back on, its as if the display hangs and you cannot write to the screen anymore. I have tried both digitalWrite and analogWrite with different pins and I get the same result. I am using a MEGA. Is there anything specific to do after the backlight turns back on?

User avatar
adafruit_support_carter
 
Posts: 29469
Joined: Tue Nov 29, 2016 2:45 pm

Re: HX8357D Backlight

Post by adafruit_support_carter »

Post the complete code listing for the sketch you are running.

User avatar
adamr1
 
Posts: 120
Joined: Sun Jun 02, 2013 8:24 am

Re: HX8357D Backlight

Post by adamr1 »

I have this:

Code: Select all

void tft_liteToggle(boolean i) {
  if(i) {analogWrite(46,255);} else {analogWrite(46,0);}
}
I've also tried with digitalWrite HIGH/LOW. What I did find is after I do the above, if I do a tft.begin(HX8357D) it works as expected so not sure but that fixes it. And after that, the last screen I had up when I turned the backlight off is there, so its not as if it resets the whole tft, it somehow fixes the problem...

User avatar
adafruit_support_carter
 
Posts: 29469
Joined: Tue Nov 29, 2016 2:45 pm

Re: HX8357D Backlight

Post by adafruit_support_carter »

Controlling the backlight should not affect the display. You can use digitalWrite to turn the backlight on/off or analogWrite to PWM to control brightness. Post complete code for the entire sketch.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”