diff --git a/examples/14-EmulatedPushButtons/14-EmulatedPushButtons.ino b/examples/14-EmulatedPushButtons/14-EmulatedPushButtons.ino index f62fa59..7469386 100644 --- a/examples/14-EmulatedPushButtons/14-EmulatedPushButtons.ino +++ b/examples/14-EmulatedPushButtons/14-EmulatedPushButtons.ino @@ -1,7 +1,7 @@ /********************************************************************************* * MIT License * - * Copyright (c) 2020 Gregg E. Berman + * Copyright (c) 2020-2022 Gregg E. Berman * * https://github.com/HomeSpan/HomeSpan * @@ -90,7 +90,7 @@ void setup() { new Service::AccessoryInformation(); new Characteristic::Identify(); new Characteristic::Name("LED Blinker"); - new DEV_Blinker(13,3); // DEV_Blinker takes two arguments - pin, and number of times to blink + new DEV_Blinker(16,3); // DEV_Blinker takes two arguments - pin, and number of times to blink } // end of setup() diff --git a/examples/15-RealPushButtons/15-RealPushButtons.ino b/examples/15-RealPushButtons/15-RealPushButtons.ino index 1fd56af..c6219a8 100644 --- a/examples/15-RealPushButtons/15-RealPushButtons.ino +++ b/examples/15-RealPushButtons/15-RealPushButtons.ino @@ -1,7 +1,7 @@ /********************************************************************************* * MIT License * - * Copyright (c) 2020 Gregg E. Berman + * Copyright (c) 2020-2022 Gregg E. Berman * * https://github.com/HomeSpan/HomeSpan * @@ -38,7 +38,6 @@ #include "HomeSpan.h" #include "DEV_LED.h" -#include "DEV_Identify.h" void setup() { @@ -132,12 +131,13 @@ void setup() { homeSpan.begin(Category::Bridges,"HomeSpan Bridge"); new SpanAccessory(); - new DEV_Identify("Bridge #1","HomeSpan","123-ABC","HS Bridge","0.9",3); - new Service::HAPProtocolInformation(); - new Characteristic::Version("1.1.0"); + new Service::AccessoryInformation(); + new Characteristic::Identify(); new SpanAccessory(); - new DEV_Identify("PushButton LED","HomeSpan","123-ABC","20mA LED","0.9",0); + new Service::AccessoryInformation(); + new Characteristic::Identify(); + new Characteristic::Name("PushButton LED"); new DEV_DimmableLED(17,23,5,18); // NEW! added three extra arguments to specify the pin numbers for three SpanButtons() - see DEV_LED.h diff --git a/examples/15-RealPushButtons/DEV_Identify.h b/examples/15-RealPushButtons/DEV_Identify.h deleted file mode 100644 index b8d21d6..0000000 --- a/examples/15-RealPushButtons/DEV_Identify.h +++ /dev/null @@ -1,38 +0,0 @@ - -////////////////////////////////// -// DEVICE-SPECIFIC SERVICES // -////////////////////////////////// - -struct DEV_Identify : Service::AccessoryInformation { - - int nBlinks; // number of times to blink built-in LED in identify routine - SpanCharacteristic *identify; // reference to the Identify Characteristic - - DEV_Identify(const char *name, const char *manu, const char *sn, const char *model, const char *version, int nBlinks) : Service::AccessoryInformation(){ - - new Characteristic::Name(name); // create all the required Characteristics with values set based on above arguments - new Characteristic::Manufacturer(manu); - new Characteristic::SerialNumber(sn); - new Characteristic::Model(model); - new Characteristic::FirmwareRevision(version); - identify=new Characteristic::Identify(); // store a reference to the Identify Characteristic for use below - - this->nBlinks=nBlinks; // store the number of times to blink the LED - - pinMode(homeSpan.getStatusPin(),OUTPUT); // make sure LED is set for output - } - - boolean update(){ - - for(int i=0;inBlinks=nBlinks; // store the number of times to blink the LED - - pinMode(homeSpan.getStatusPin(),OUTPUT); // make sure LED is set for output - } - - boolean update(){ - - for(int i=0;i