Waveform Generator added

This commit is contained in:
Joe Tretter
2020-09-22 22:08:02 -05:00
parent e490c42898
commit ec749f6b02
8 changed files with 187 additions and 2 deletions

View File

@@ -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