Tested homeSpan.setStatusDevice() to create a reverseLED
This commit is contained in:
parent
a2731412b3
commit
568c13fee3
15
src/src.ino
15
src/src.ino
|
|
@ -47,6 +47,17 @@ struct LED_Service : Service::LightBulb {
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
|
|
||||||
|
struct reverseLED : Blinkable {
|
||||||
|
|
||||||
|
int pin;
|
||||||
|
|
||||||
|
reverseLED(int pin) : pin{pin} {pinMode(pin,OUTPUT);digitalWrite(pin,1);}
|
||||||
|
void on() override {digitalWrite(pin,LOW);}
|
||||||
|
void off() override {digitalWrite(pin,HIGH);}
|
||||||
|
int getPin() override {return(pin);}
|
||||||
|
};
|
||||||
|
|
||||||
|
//////////////////////////////////////
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
||||||
|
|
@ -56,8 +67,8 @@ void setup() {
|
||||||
// homeSpan.setSerialInputDisable(true);
|
// homeSpan.setSerialInputDisable(true);
|
||||||
homeSpan.enableOTA();
|
homeSpan.enableOTA();
|
||||||
|
|
||||||
homeSpan.setStatusPin(13);
|
homeSpan.setStatusDevice(new reverseLED(13));
|
||||||
homeSpan.setStatusAutoOff(20);
|
homeSpan.setStatusAutoOff(30);
|
||||||
|
|
||||||
homeSpan.begin(Category::Lighting,"HomeSpan LED");
|
homeSpan.begin(Category::Lighting,"HomeSpan LED");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue