#include"HomeSpan.h" #include"extras/PwmPin.h"// library of various PWM functions
////////////////////////////////////
structFadingLED : Service::LightBulb { LedPin *ledPin; // reference to Led Pin SpanCharacteristic *power; // reference to the On Characteristic SpanCharacteristic *level; // reference to the Brightness Characteristic SpanCharacteristic *colorTemperature; // reference to the Color Temperature
FadingLED(int _ledPin) : Service::LightBulb() { power = new Characteristic::On(); level = new Characteristic::Brightness(0); colorTemperature = new Characteristic::ColorTemperature(200, true); ledPin = newLedPin(_ledPin); }
Serial.println("Wi-Fi is Connected!"); homeSpan.enableOTA("12345678"); homeSpan.setPairingCode("11223344"); homeSpan.begin(Category::Lighting, "Lamp++");
newSpanAccessory(); new Service::AccessoryInformation(); new Characteristic::Identify(); new Characteristic::ColorTemperature(200, true); newFadingLED(4); }