mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-05-19 10:32:56 +00:00
parent
1278c01fcd
commit
f173558bd5
1 changed files with 13 additions and 7 deletions
20
src/main.cpp
20
src/main.cpp
|
@ -105,21 +105,27 @@ void setup()
|
|||
brightness_led = config.getUInt("led-brightness", DEFAULT_LED_BRIGHTNESS);
|
||||
config.end();
|
||||
analogWrite(PIN_LED, brightness_led);
|
||||
// delay(5000);
|
||||
ledBlink(500);
|
||||
|
||||
// Button
|
||||
pinMode(PIN_BUTTON, INPUT_PULLUP);
|
||||
if (digitalRead(PIN_BUTTON) == LOW)
|
||||
{
|
||||
ledBlink(100);
|
||||
delay(2000);
|
||||
Serial.println("Reset config");
|
||||
config.begin("dmx", false);
|
||||
config.clear();
|
||||
config.end();
|
||||
unsigned long startTime = millis();
|
||||
while (digitalRead(PIN_BUTTON) == LOW && (millis() - startTime >= 5000))
|
||||
{
|
||||
}
|
||||
if (digitalRead(PIN_BUTTON) == LOW)
|
||||
{
|
||||
Serial.println("Reset config");
|
||||
config.begin("dmx", false);
|
||||
config.clear();
|
||||
config.end();
|
||||
}
|
||||
}
|
||||
|
||||
ledBlink(500);
|
||||
|
||||
// wait for serial monitor
|
||||
delay(5000);
|
||||
Serial.println("Starting DMX-Interface...");
|
||||
|
|
Loading…
Add table
Reference in a new issue