// https://programmersqtcpp.blogspot.com/2022/08/esp32-pwm-pin.html
#define LEDBLUE 21
#define LEDRED 19
void setup() {
Serial.begin(115200);
double result = ledcSetup(0, 875, 11); // ch 0, f 875Hz, res 11-bit
if (!result) Serial.println("errore");
Serial.println(result);
ledcAttachPin(LEDRED, 0); // attach LEDRED on ch 0
ledcAttachPin(LEDBLUE, 0); // attach LEDBLUE on ch 0
for (uint16_t i=0; i<2048; i++) {
delay(1);
ledcWrite(0, i);
if (i == 2047) Serial.println("Ok");
}
}
void loop() {
delay(1);
}