diff --git a/README.md b/README.md index 0b4b29f..80f450d 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ All print files (STL, STEP, X_T) can be found in [assets/case](/assets/case/). A ## ⚙️ Default config -To reset the settings, hold down the button and connect the ESP to the power supply. As soon as the LED flashes quickly, the settings are reset. +To reset the settings, hold down the button and connect the ESP to the power supply, the LED will flash quickly. After 3 seconds the LED should light up static and the settings are reset. If you release the button early you abort the reset and the LED flashes slowly. | Setting | Value | | -------------- | ------------------ | diff --git a/src/main.cpp b/src/main.cpp index 6a15209..9dccc71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,21 +100,29 @@ void setup() // LED 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 <= 3000)) + { + } + if (digitalRead(PIN_BUTTON) == LOW) + { + ledBlink(1); + Serial.println("Reset config"); + config.begin("dmx", false); + config.clear(); + config.end(); + delay(2000); + } } + ledBlink(500); + // wait for serial monitor delay(5000); Serial.println("Starting DMX-Interface...");