From 347fa66cc30b97b7f76585acc23fb8f35433ebca Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sun, 28 Mar 2021 01:24:55 +0100 Subject: [PATCH] Don't use 10kHz, but 9765Hz for white channel PWM. --- yeelight_bs2_light_output.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yeelight_bs2_light_output.h b/yeelight_bs2_light_output.h index e10b5d7..778ffd4 100644 --- a/yeelight_bs2_light_output.h +++ b/yeelight_bs2_light_output.h @@ -34,7 +34,11 @@ namespace rgbww { // The PWM frequencies as used by the original device // for driving the LED circuitry. const float RGB_PWM_FREQUENCY = 3000.0f; - const float WHITE_PWM_FREQUENCY = 3000.0f; + // I measured 10kHz for this channel, but making this 10000.0f results + // in the blue channel failing. So possibly this is the actual + // frequency to use (it's the frequency that provides a 13 bit + // bith depth to the PWM channel). + const float WHITE_PWM_FREQUENCY = 9765.0f; class YeelightBS2LightOutput : public Component, public light::LightOutput {