From b53dee396ecdde3ee687d426cb1a12ce0f894a9e Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 8 May 2020 15:42:44 +0200 Subject: [PATCH] Lower minimum PWMFrequency to 40Hz --- tasmota/core_esp8266_wiring_pwm.cpp | 4 ++-- tasmota/tasmota.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tasmota/core_esp8266_wiring_pwm.cpp b/tasmota/core_esp8266_wiring_pwm.cpp index 90d69b313..984ce92db 100644 --- a/tasmota/core_esp8266_wiring_pwm.cpp +++ b/tasmota/core_esp8266_wiring_pwm.cpp @@ -45,8 +45,8 @@ extern void __analogWriteRange(uint32_t range) { extern void __analogWriteFreq(uint32_t freq) { - if (freq < 100) { - analogFreq = 100; + if (freq < 40) { // Arduino sets a minimum of 100Hz, waiting for them to change this one. + analogFreq = 40; } else if (freq > 60000) { analogFreq = 60000; } else { diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 77bbb6786..cca1af80f 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -106,7 +106,7 @@ const uint32_t PWM_RANGE = 1023; // 255..1023 needs to be devisible b //const uint16_t PWM_FREQ = 910; // 100..1000 Hz led refresh (iTead value) const uint16_t PWM_FREQ = 223; // 100..4000 Hz led refresh const uint16_t PWM_MAX = 4000; // [PWM_MAX] Maximum frequency - Default: 4000 -const uint16_t PWM_MIN = 100; // [PWM_MIN] Minimum frequency - Default: 100 +const uint16_t PWM_MIN = 40; // [PWM_MIN] Minimum frequency - Default: 40 // For Dimmers use double of your mains AC frequecy (100 for 50Hz and 120 for 60Hz) // For Controlling Servos use 50 and also set PWM_FREQ as 50 (DO NOT USE THESE VALUES FOR DIMMERS)