Nkawu / TFT_22_ILI9225

Arduino library for 2.2" TFT display modules with ILI9225 driver
GNU General Public License v3.0
82 stars 43 forks source link

How to fade backlight? #28

Open ajk1982 opened 6 years ago

ajk1982 commented 6 years ago

Thanks for creating this library! One thing I am struggling with is the backlight. I have tried various things to get the backlight to fade in. It seems all I can do is have it on or off. For example when analog write goes over 127 and backlight come on then when it goes below 128 it turns off. Do you think you could possibly provide an example sketch in the library demonstrating this?

Nkawu commented 6 years ago

Another contributor added this functionality to the library. I will try to test it as soon as I can to verify.

PeratX commented 6 years ago

You should connect the LED pin to a hardware PWM pin. (I am using ATmega2560, so I connect it to pin 3) Then just use the TFT_22_ILI9225::setBacklightBrightness() to change it