mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-07-05 21:58:53 +00:00
Merge pull request #43 from HendrikRauh/HendrikRauh/issue39
Reset protection
This commit is contained in:
commit
330d4ffa42
2 changed files with 16 additions and 8 deletions
|
@ -86,7 +86,7 @@ All print files (STL, STEP, X_T) can be found in [assets/case](/assets/case/). A
|
||||||
|
|
||||||
## ⚙️ Default config
|
## ⚙️ 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 |
|
| Setting | Value |
|
||||||
| -------------- | ------------------ |
|
| -------------- | ------------------ |
|
||||||
|
|
22
src/main.cpp
22
src/main.cpp
|
@ -100,21 +100,29 @@ void setup()
|
||||||
|
|
||||||
// LED
|
// LED
|
||||||
analogWrite(PIN_LED, brightness_led);
|
analogWrite(PIN_LED, brightness_led);
|
||||||
// delay(5000);
|
|
||||||
ledBlink(500);
|
|
||||||
|
|
||||||
// Button
|
// Button
|
||||||
pinMode(PIN_BUTTON, INPUT_PULLUP);
|
pinMode(PIN_BUTTON, INPUT_PULLUP);
|
||||||
if (digitalRead(PIN_BUTTON) == LOW)
|
if (digitalRead(PIN_BUTTON) == LOW)
|
||||||
{
|
{
|
||||||
ledBlink(100);
|
ledBlink(100);
|
||||||
delay(2000);
|
unsigned long startTime = millis();
|
||||||
Serial.println("Reset config");
|
while (digitalRead(PIN_BUTTON) == LOW && (millis() - startTime <= 3000))
|
||||||
config.begin("dmx", false);
|
{
|
||||||
config.clear();
|
}
|
||||||
config.end();
|
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
|
// wait for serial monitor
|
||||||
delay(5000);
|
delay(5000);
|
||||||
Serial.println("Starting DMX-Interface...");
|
Serial.println("Starting DMX-Interface...");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue