fixed confusing syntax

Fixes #48
This commit is contained in:
Hendrik Rauh 2024-12-15 20:38:14 +01:00 committed by RaffaelW
parent 66cf008e19
commit 0b0bf2f737

View file

@ -75,12 +75,7 @@ void ledBlink(int ms)
timer = timerBegin(0, 80, true); // timer 0, prescalar: 80, UP counting timer = timerBegin(0, 80, true); // timer 0, prescalar: 80, UP counting
timerAttachInterrupt(timer, &onTimer, true); // Attach interrupt timerAttachInterrupt(timer, &onTimer, true); // Attach interrupt
} }
if (ms == 0) else if (ms == 0)
{
timerAlarmDisable(timer);
analogWrite(PIN_LED, 0);
}
else if (ms == 1)
{ {
timerAlarmDisable(timer); timerAlarmDisable(timer);
analogWrite(PIN_LED, brightness_led); analogWrite(PIN_LED, brightness_led);
@ -117,7 +112,7 @@ void setup()
} }
if (digitalRead(PIN_BUTTON) == LOW) if (digitalRead(PIN_BUTTON) == LOW)
{ {
ledBlink(1); ledBlink(0);
Serial.println("Reset config"); Serial.println("Reset config");
config.begin("dmx", false); config.begin("dmx", false);
config.clear(); config.clear();
@ -333,7 +328,7 @@ void setup()
// scan networks and cache them // scan networks and cache them
WiFi.scanNetworks(true); WiFi.scanNetworks(true);
ledBlink(1); ledBlink(0);
} }
void loop() void loop()