const int pinLed = 21;
const int channel = 1; //0 - 15 Kanäle
const int frequency = 1000; //1000 Hz oder 1000 Perioden pro Sekunde
const int resolution = 7; //8 Bit -> Wertebereich 0 - 255 / von 1-16 Bit
void setup() {
pinMode(pinLed, OUTPUT);
ledcSetup(channel, frequency, resolution);
ledcAttachPin(pinLed, channel);
Serial.begin(115200);
}
void loop() {
for(int i = 0; i<255; i++){
ledcWrite(channel, i);
delay(50);
}
Serial.println("LED Wird Dunkel");
for(int j = 255; j>0; j--){
ledcWrite(channel, j);
delay(50);
}
Serial.println("LED Wird Hell");
}