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
12
src/main.cpp
12
src/main.cpp
|
@ -105,20 +105,26 @@ void setup()
|
||||||
brightness_led = config.getUInt("led-brightness", DEFAULT_LED_BRIGHTNESS);
|
brightness_led = config.getUInt("led-brightness", DEFAULT_LED_BRIGHTNESS);
|
||||||
config.end();
|
config.end();
|
||||||
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();
|
||||||
|
while (digitalRead(PIN_BUTTON) == LOW && (millis() - startTime >= 5000))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (digitalRead(PIN_BUTTON) == LOW)
|
||||||
|
{
|
||||||
Serial.println("Reset config");
|
Serial.println("Reset config");
|
||||||
config.begin("dmx", false);
|
config.begin("dmx", false);
|
||||||
config.clear();
|
config.clear();
|
||||||
config.end();
|
config.end();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ledBlink(500);
|
||||||
|
|
||||||
// wait for serial monitor
|
// wait for serial monitor
|
||||||
delay(5000);
|
delay(5000);
|
||||||
|
|
Loading…
Add table
Reference in a new issue