diff --git a/src/main.cpp b/src/main.cpp index a1c78a4..a9efb3e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,7 +11,7 @@ void setup() { // Initialize channels // channels 0-15, resolution 1-16 bits, freq limits depend on resolution // ledcSetup(uint8_t channel, uint32_t freq, uint8_t resolution_bits); - ledcSetup(0, 4000, 8); // 12 kHz PWM, 8-bit resolution + ledcSetup(0, 12000, 8); // 12 kHz PWM, 8-bit resolution } // the loop routine runs over and over again forever: @@ -22,7 +22,7 @@ void loop() { brightness = brightness + fadeAmount; // reverse the direction of the fading at the ends of the fade: - if (brightness <= 0 || brightness >= 255) { + if (brightness <= 0 || brightness >= 254) { fadeAmount = -fadeAmount; } // wait for 30 milliseconds to see the dimming effect