Skip to content

Commit

Permalink
✨ Add LED_ON, LED_OFF and LED_PIN
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinroger committed Apr 4, 2017
1 parent 69c7b07 commit a52cfbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SonoffDual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SonoffDualButton SonoffDualClass::handleButton() {
}

void SonoffDualClass::setLed(bool on) {
digitalWrite(LED_PIN, on ? LOW : HIGH);
digitalWrite(LED_PIN, on ? LED_ON : LED_OFF);
}

void SonoffDualClass::setRelays(bool first, bool second) {
Expand Down
6 changes: 4 additions & 2 deletions SonoffDual.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ enum class SonoffDualButton : uint8_t {
};

namespace SonoffDualInternal {
const uint8_t LED_PIN = 13;

class SonoffDualClass {
public:
SonoffDualClass();
void setup();
::SonoffDualButton handleButton();
void setLed(bool on);
void setRelays(bool first, bool second);

const uint8_t LED_PIN = 13;
const uint8_t LED_ON = LOW;
const uint8_t LED_OFF = HIGH;
};
}

Expand Down
4 changes: 4 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ setRelays KEYWORD2
NONE LITERAL1
SHORT LITERAL1
LONG LITERAL1

LED_PIN LITERAL1
LED_ON LITERAL1
LED_OFF LITERAL1

0 comments on commit a52cfbf

Please sign in to comment.