From 129f8ec2b29e4be7d7a724fe98595b33e8d8e8e6 Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Tue, 22 Sep 2020 22:08:02 -0500 Subject: [PATCH] Waveform Generator added --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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