fix adc range

master
interfisch 1 year ago
parent 1cc242c76b
commit aa9f3effcb
  1. 4
      platformio.ini
  2. 6
      src/main.cpp

@ -29,8 +29,8 @@ lib_deps =
build_flags =
-D DUALCOLOR
-D LED_CW=12 ;D6 = GPIO12 (pin6)
-D LED_WW=14 ;D5 = GPIO14 (pin5)
-D LED_WW=12 ;D6 = GPIO12 (pin6)
-D LED_CW=14 ;D5 = GPIO14 (pin5)
-D BTN_A=13 ;D7 = GPIO13 (pin 7)
-D BTN_B=15 ;D8 = GPIO15 (pin 10)
-D PWM_FREQUENCY=500 ;default: 1000 Hz

@ -90,6 +90,7 @@ void setup() {
Serial.begin(115200);
Serial.println("Hello");
analogWriteRange(PWM_MAX);
analogWriteFreq(PWM_FREQUENCY);
#ifdef DUALCOLOR
pinMode(LED_WW, OUTPUT);
@ -318,7 +319,6 @@ void loopHandler() {
if (enable_fadevalue<0) { enable_fadevalue=0; } //limit
flag_updatePWM=true; //force update
}
//calculate and update pwm
#ifdef DUALCOLOR
if (brightness != set_brightness || temperature != set_temperature || flag_updatePWM) { //if target not reached
@ -353,10 +353,6 @@ void loopHandler() {
analogWrite(LED_PWM, PWM_MAX-pwm); //full pwm is led off
#endif
}
}

Loading…
Cancel
Save