LaskaKit / ESPink-42

Other
9 stars 4 forks source link

Compatibility with arduino-esp32: 3.x #4

Closed PexMor closed 2 months ago

PexMor commented 2 months ago

https://github.com/LaskaKit/ESPink-42/blob/da1134c9fca5b908fcb62d94b190ed9c36872ec6/SW/Simple/Touch_and_light_example/Touch_and_light_example.ino#L43-L45

TL-DR: conditionally replace with ledcAttach(DISPLAY_LED, 1000, 8);

The lines above has new form on ardiuno-esp32 v3.x

The two lines updated with:

// configure backlight LED PWM functionalitites
// ledcSetup(1, 1000, 8);          // ledChannel, freq, resolution
// ledcAttachPin(DISPLAY_LED, 1);  // ledPin, ledChannel
// was 2.x:
// ledcSetup(X_PWM_CHANNEL, X_PWM_FREQ, PWM_RESOLUTION);
// ledcAttachPin(X_PWM_OUT, X_PWM_CHANNEL);
// ledcSetup(channel, freq, resolution);
// ledcAttachPin(used_pin, channel);
// new 3.x:
// bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution);

ledcAttach(DISPLAY_LED, 1000, 8);
Konstantin-G commented 2 months ago

Updated, thanks