Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses the v2.x ESP32 API, so doesn't compile with v3.0 #1

Open
twj42 opened this issue Aug 15, 2024 · 5 comments
Open

Uses the v2.x ESP32 API, so doesn't compile with v3.0 #1

twj42 opened this issue Aug 15, 2024 · 5 comments

Comments

@twj42
Copy link

twj42 commented Aug 15, 2024

The spec for ledcAttach has changed from v2 to v3 - functions of ledcSetup and ledcAttachPin are now merged.

@a10kiloham
Copy link

even with that fixed it goes into a bootloop now

@ajdrew
Copy link

ajdrew commented Aug 18, 2024

Would it be possible to get these two lines re-written for the v3.0 API?

ledcSetup(0, 10000, 8);
ledcAttachPin(38, 0);

I'm struggling translating the above into the new v3.0 API statement.

ledcAttach();

I have found this article, but I'm having a difficult time translating v2.0 to v3.0. Not a lot of information and I'm new at this.
https://docs.espressif.com/projects/arduino-esp32/en/latest/api/ledc.html#ledcattach

@AussiSG
Copy link

AussiSG commented Oct 21, 2024

Edit 20241022:
It seems that LilyGo / ESP Community is aware of the problem
image
Bodmer/TFT_eSPI#3329

I dont have the board yet.

But you can try this, starts approx on 81 :

  //set brightness
  #if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 0)
  ledcSetup(0, 10000, 8);
  ledcAttachPin(38, 0);
  ledcWrite(0, 130);
  #else
  ledcAttach(TFT_BL, 10000, 8);
  ledcWrite(TFT_BL, 130);
  #endif

@AussiSG
Copy link

AussiSG commented Oct 22, 2024

Hmm ,

Been playing around with ESP libraries back and forth, but this seems to have done the trick.
Also played with #define USE_HSPI_PORT , commenting and uncomenting this. As mentioned in the issue linked here above.
But I eventually kept it commented.

Currently my weather station is operational on a V3.0.6 ESP32 library with the settings below.
I did had to manually reset the ESP32 once to get it up around, so it didn't directly start after an upload

User_Setup.h in TFT_eSPI library, eventually left #define USE_HSPI_PORT commented

// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
//#define USE_HSPI_PORT

Uncommented in User_Setup_Select.h in TFT_eSPI library

// S3 Display 
#include <User_Setups/Setup206_LilyGo_T_Display_S3.h>     // For the LilyGo T-Display S3 based ESP32S3 with ST7789 170 x 320 TFT

Weather.ino part

  ////set brightness
  #if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 0)
    ledcSetup(0, 10000, 8);
    ledcAttachPin(38, 0);
    ledcWrite(0, 130);
  #else
    ledcAttach(TFT_BL, 10000, 8);
    ledcWrite(TFT_BL, 130);
  #endif

@AussiSG
Copy link

AussiSG commented Oct 27, 2024

You can check out my updated version , compatible with both library. atleast for me :)
Also contains brightness adjustment with the right button / button 2

https://github.com/AussiSG/tDisplayS3WeatherStation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants