#define LED_PIN 26
const int ledChannel = 0;
const int frequency = 8000;
const int resolution = 12;
int duty = 0;
void setup() {
ledcSetup(ledChannel, frequency, resolution);
ledcAttachPin(LED_PIN, ledChannel);
}
void loop() {
if (duty <= 4095) {
ledcWrite(ledChannel, duty);
duty += 100;
} else {
ledcWrite(ledChannel, duty);
duty = 0;
}
delay(100);
}