diff --git a/code/src/config/hardware.h b/code/src/config/hardware.h index 1c0e173f..1a4ef2af 100644 --- a/code/src/config/hardware.h +++ b/code/src/config/hardware.h @@ -21,6 +21,7 @@ #define BUTTON_PIN 0 #define RELAY_PIN 12 #define LED_PIN 13 + #define LED_PIN_INVERSE 0 #elif defined(SONOFF_TH) @@ -29,6 +30,7 @@ #define BUTTON_PIN 0 #define RELAY_PIN 12 #define LED_PIN 13 + #define LED_PIN_INVERSE 0 #elif defined(SONOFF_POW) @@ -37,6 +39,7 @@ #define BUTTON_PIN 0 #define RELAY_PIN 12 #define LED_PIN 15 + #define LED_PIN_INVERSE 1 #define ENABLE_POW 1 #elif defined(SLAMPHER) @@ -46,6 +49,7 @@ #define BUTTON_PIN 0 #define RELAY_PIN 12 #define LED_PIN 13 + #define LED_PIN_INVERSE 0 #elif defined(S20) @@ -54,6 +58,7 @@ #define BUTTON_PIN 0 #define RELAY_PIN 12 #define LED_PIN 13 + #define LED_PIN_INVERSE 0 // ----------------------------------------------------------------------------- // ESPurna board (still beta) @@ -66,6 +71,7 @@ #define BUTTON_PIN 0 #define RELAY_PIN 12 #define LED_PIN 13 + #define LED_PIN_INVERSE 0 // ----------------------------------------------------------------------------- // Unknown hardware diff --git a/code/src/main.ino b/code/src/main.ino index b8b6a066..b8282859 100644 --- a/code/src/main.ino +++ b/code/src/main.ino @@ -46,7 +46,7 @@ void blink(unsigned long delayOff, unsigned long delayOn) { static bool status = HIGH; if (next < millis()) { status = !status; - digitalWrite(LED_PIN, status); + digitalWrite(LED_PIN, LED_PIN_INVERSE ? !status : status); next += ((status) ? delayOff : delayOn); } }