Browse Source

Option to define LED in inverse logic

fastled
Xose Pérez 8 years ago
parent
commit
1551b3d1e3
2 changed files with 7 additions and 1 deletions
  1. +6
    -0
      code/src/config/hardware.h
  2. +1
    -1
      code/src/main.ino

+ 6
- 0
code/src/config/hardware.h View File

@ -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


+ 1
- 1
code/src/main.ino View File

@ -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);
}
}


Loading…
Cancel
Save