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

setbacklight() function can not control LCD's backlight #66

Open be-engineer opened 4 years ago

be-engineer commented 4 years ago

When I use ESP32 Dev module to control TFT LCD ILI9225, I found that setbacklight() and setBacklightBrightness() can not work, backlight pin still remain LOW. Then I found out the following code in the setbacklight () function in the TFT_22_ILI9225.cpp file by debugging the code      # ifndef ESP32      if (_led)          analogWrite (_led, blState? _brightness: 0);      # endif When I commented out #ifndef ESP32 statement, setbacklight () worked normally.I don't know why add these two pre-coniles codes?

blkhawk commented 3 years ago

I think analogWrite depends on what libraries you include on ESP32. I had to include https://github.com/ERROPiX/ESP32_AnalogWrite for it to work normally. Maybe this could be reflected in a comment there?