Skip to content

Commit

Permalink
Support IDF5 in 4-BacklightControlTest.ino (#219)
Browse files Browse the repository at this point in the history
* Add support for IDF5
  • Loading branch information
TheNitek authored Jun 24, 2024
1 parent d659281 commit 55f1e8c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ void setup() {

// Setting up the LEDC and configuring the Back light pin
// NOTE: this needs to be done after tft.init()
#if ESP_IDF_VERSION_MAJOR == 5
ledcAttach(LCD_BACK_LIGHT_PIN, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT);
#else
ledcSetup(LEDC_CHANNEL_0, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT);
ledcAttachPin(LCD_BACK_LIGHT_PIN, LEDC_CHANNEL_0);
#endif

tft.setRotation(1); //This is the display in landscape

Expand Down

0 comments on commit 55f1e8c

Please sign in to comment.