From f3362835aa180d5538433b1bfec82168f857aeb1 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 12 Oct 2019 17:11:53 +0200 Subject: [PATCH] fix light flash at first toggle --- controllerHomie/controllerHomie.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controllerHomie/controllerHomie.ino b/controllerHomie/controllerHomie.ino index bfacb0b..9c9814c 100644 --- a/controllerHomie/controllerHomie.ino +++ b/controllerHomie/controllerHomie.ino @@ -61,14 +61,14 @@ float set_brightness=0; //0 to 1 #define BRIGHTNESS_MIN 0.0 #define BRIGHTNESS_MAX 2.0 //if temperature is in between both strips brightness of 2 means both are at full power. otherwise brightness will be clipped float brightness=set_brightness; -float brightness_change_per_loop=100; //will be calculated by Handler +float brightness_change_per_loop=0; //will be calculated by Handler #define TEMPERATURE_MIN 2760 //temperature of warm white leds #define TEMPERATURE_MAX 5640//temperature of cold white leds float set_temperature=(TEMPERATURE_MAX+TEMPERATURE_MIN)/2; float temperature=set_temperature; -float temperature_change_per_loop=100; //will be calculated by Handler +float temperature_change_per_loop=0; //will be calculated by Handler uint16_t fadetime=0; //0=instant. value is time in milliseconds #define FADETIME_MIN 0 @@ -103,8 +103,8 @@ void setup() { Serial.println("Hello"); pinMode(LED_WW, OUTPUT); pinMode(LED_CW, OUTPUT); - digitalWrite(LED_CW, HIGH); //high = off - digitalWrite(LED_WW, HIGH); //high = off + analogWrite(LED_CW, PWM_MAX); //high = off + analogWrite(LED_WW, PWM_MAX); //high = off pinMode(BTN_A, INPUT); pinMode(BTN_B, INPUT);