From 568c13fee3a580b851dac1a88de869a3e0c6f81a Mon Sep 17 00:00:00 2001 From: Gregg Date: Sun, 2 Jul 2023 17:12:58 -0500 Subject: [PATCH] Tested homeSpan.setStatusDevice() to create a reverseLED --- src/src.ino | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/src.ino b/src/src.ino index e0f2c4f..8eeafc0 100644 --- a/src/src.ino +++ b/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() { @@ -56,8 +67,8 @@ void setup() { // homeSpan.setSerialInputDisable(true); homeSpan.enableOTA(); - homeSpan.setStatusPin(13); - homeSpan.setStatusAutoOff(20); + homeSpan.setStatusDevice(new reverseLED(13)); + homeSpan.setStatusAutoOff(30); homeSpan.begin(Category::Lighting,"HomeSpan LED");