From 59a37bb2bbf92d00d469bd3506d06bced508764a Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 10:19:51 -0600 Subject: [PATCH 01/18] Update Reference.md --- docs/Reference.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Reference.md b/docs/Reference.md index 7c7f8de..51409fe 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -155,4 +155,6 @@ HomeSpan automatically calls the `button(int pin, int pressType)` method of a Se HomeSpan will report a warning, but not an error, during initialization if the user had not overridden the virtual button() method for a Service contaning one or more Buttons; triggers of those Buttons will simply ignored. +--- +[↩️](README.md) Back to the Welcome page From f6b7649d483037de0af174eb42204773322395d4 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 10:20:25 -0600 Subject: [PATCH 02/18] Update README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index c741d56..4bb04ad 100644 --- a/docs/README.md +++ b/docs/README.md @@ -54,7 +54,7 @@ HomeSpan includes the following documentation: * [HomeSpan Accessory Categories](Categories.md) - a list of all HAP Accessory Categories defined by HomeSpan * [HomeSpan Command-Line Interface (CLI)](CLI.md) - configure a HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, monitor and update its status, and access detailed, real-time device diagnostics from the Arduino IDE Serial Monitor * [HomeSpan User Guide](UserGuide.md) - turnkey instructions on how to configure an already-programmed HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, and pair the device to HomeKit. No computer needed! -* [HomeSpan API Reference](Reference.md) - a complete guide to the HomeSpan Library API :construction: +* [HomeSpan API Reference](Reference.md) - a complete guide to the HomeSpan Library API # External Resources From 3683a74e9c7ae1bed65db4e00b666d694d3831a1 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 11:18:39 -0600 Subject: [PATCH 03/18] Update README.md --- docs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 4bb04ad..666a4c1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,7 +7,7 @@ HomeSpan provides a microcontroller-focused implementation of [Apple's HomeKit A ### HomeSpan Highlights * Provides a natural, intuitive, and **very** easy-to-use framework -* Utilizes a unique *Service-Centric* approach to creating HomeKit devices +* Utilizes a unique [Service-Centric](Overview.md#connecting-homespan-to-real-world-appliances) approach to creating HomeKit devices * Takes full advantage of the widely-popular Arduino IDE * 100% HAP-R2 compliance * 38 integrated [HomeKit Services](ServiceList.md) @@ -18,10 +18,10 @@ HomeSpan provides a microcontroller-focused implementation of [Apple's HomeKit A * Extensive use of the Arduino Serial Monitor * Real-time, easy-to-understand diagnostics * Complete transparency to every underlying HomeKit action, data request, and data response - * Command-line interface with a variety of info, debugging, and configuration commands + * [Command-line interface](CLI.md) with a variety of info, debugging, and configuration commands * Built-in database validation to ensure your configuration meets all HAP requirements * Integrated PWM functionality supporting pulse-wave-modulation on any ESP32 pin -* Integrated Push Button functionality supporting single, double, and long presses +* Integrated [Push Button](Reference.md#spanbuttonint-pin-uint16_t-longtime-uint16_t-singletime-uint16_t-doubletime) functionality supporting single, double, and long presses * Integrated access to the ESP32's on-chip Remote Control peripheral for easy generation of IR and RF signals * 16 detailed [tutorial-sketches](Tutorials.md) with extensive comments, HomeSpan documentation and tips and tricks From 52bd344a71f2ab2f6d364f667a4cc387c81affdd Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 11:21:54 -0600 Subject: [PATCH 04/18] Update README.md --- docs/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/README.md b/docs/README.md index 666a4c1..38eeafa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,10 +7,10 @@ HomeSpan provides a microcontroller-focused implementation of [Apple's HomeKit A ### HomeSpan Highlights * Provides a natural, intuitive, and **very** easy-to-use framework -* Utilizes a unique [Service-Centric](Overview.md#connecting-homespan-to-real-world-appliances) approach to creating HomeKit devices +* Utilizes a unique *Service-Centric* approach to creating HomeKit devices * Takes full advantage of the widely-popular Arduino IDE * 100% HAP-R2 compliance -* 38 integrated [HomeKit Services](ServiceList.md) +* 38 integrated HomeKit Services * Operates in either Accessory or Bridge mode ### For the HomeSpan Developer @@ -18,12 +18,12 @@ HomeSpan provides a microcontroller-focused implementation of [Apple's HomeKit A * Extensive use of the Arduino Serial Monitor * Real-time, easy-to-understand diagnostics * Complete transparency to every underlying HomeKit action, data request, and data response - * [Command-line interface](CLI.md) with a variety of info, debugging, and configuration commands + * Command-line interface with a variety of info, debugging, and configuration commands * Built-in database validation to ensure your configuration meets all HAP requirements * Integrated PWM functionality supporting pulse-wave-modulation on any ESP32 pin -* Integrated [Push Button](Reference.md#spanbuttonint-pin-uint16_t-longtime-uint16_t-singletime-uint16_t-doubletime) functionality supporting single, double, and long presses +* Integrated Push Button functionality supporting single, double, and long presses * Integrated access to the ESP32's on-chip Remote Control peripheral for easy generation of IR and RF signals -* 16 detailed [tutorial-sketches](Tutorials.md) with extensive comments, HomeSpan documentation and tips and tricks +* 16 detailed tutorial-sketches with extensive comments, HomeSpan documentation and tips and tricks ### For the HomeSpan End-User @@ -34,7 +34,7 @@ HomeSpan provides a microcontroller-focused implementation of [Apple's HomeKit A * Force-unpair the device from HomeKit * Perform a Factory Reset * Launch the WiFi Access Point -* A standalone, detailed [End-User Guide](UserGuide.md) +* A standalone, detailed End-User Guide # Latest Updates From 98be7b991d9554298ac695cd3606705b6a9bc1c9 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 11:24:29 -0600 Subject: [PATCH 05/18] Update README.md --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index 38eeafa..93b15a9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -55,6 +55,7 @@ HomeSpan includes the following documentation: * [HomeSpan Command-Line Interface (CLI)](CLI.md) - configure a HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, monitor and update its status, and access detailed, real-time device diagnostics from the Arduino IDE Serial Monitor * [HomeSpan User Guide](UserGuide.md) - turnkey instructions on how to configure an already-programmed HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, and pair the device to HomeKit. No computer needed! * [HomeSpan API Reference](Reference.md) - a complete guide to the HomeSpan Library API +* [HomeSpan Extras](Extras.md) - integrated access to the ESP32's on-chip PWM and Remote Control peripherals # External Resources From 2c00eda424670e6352834cb6fcb295f68aec3d5c Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 11:24:55 -0600 Subject: [PATCH 06/18] Update README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 93b15a9..e0da85d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -55,7 +55,7 @@ HomeSpan includes the following documentation: * [HomeSpan Command-Line Interface (CLI)](CLI.md) - configure a HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, monitor and update its status, and access detailed, real-time device diagnostics from the Arduino IDE Serial Monitor * [HomeSpan User Guide](UserGuide.md) - turnkey instructions on how to configure an already-programmed HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, and pair the device to HomeKit. No computer needed! * [HomeSpan API Reference](Reference.md) - a complete guide to the HomeSpan Library API -* [HomeSpan Extras](Extras.md) - integrated access to the ESP32's on-chip PWM and Remote Control peripherals +* [HomeSpan Extras](Extras.md) - integrated access to the ESP32's on-chip PWM and Remote Control peripherals :construction: # External Resources From 051ec409cb594656ddde3c5608781cfb3e1f1080 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 11:28:48 -0600 Subject: [PATCH 07/18] Create Extras.md --- docs/Extras.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/Extras.md diff --git a/docs/Extras.md b/docs/Extras.md new file mode 100644 index 0000000..ae1c419 --- /dev/null +++ b/docs/Extras.md @@ -0,0 +1,7 @@ +# HomeSpan Extras + +HomeSpan includes integrated access to a number of ESP32 features you'll likely find particularly useful when constructing your HomeSpan devices. + +--- + +[↩️](README.md) Back to the Welcome page From e4d000f9420ec19f990180b8c0978c0bacdd1003 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 11:29:53 -0600 Subject: [PATCH 08/18] Update HomeKitPrimer.md --- docs/HomeKitPrimer.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/HomeKitPrimer.md b/docs/HomeKitPrimer.md index f5ec0a1..4ffad02 100644 --- a/docs/HomeKitPrimer.md +++ b/docs/HomeKitPrimer.md @@ -1,3 +1,7 @@ # HomeKit Primer *(coming soon)* + +--- + +[↩️](README.md) Back to the Welcome page From 7d5e18555d3d18f6414e96ebd0c5ee81d964acf5 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 13:38:13 -0600 Subject: [PATCH 09/18] Update README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index e0da85d..c646fb6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -55,7 +55,7 @@ HomeSpan includes the following documentation: * [HomeSpan Command-Line Interface (CLI)](CLI.md) - configure a HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, monitor and update its status, and access detailed, real-time device diagnostics from the Arduino IDE Serial Monitor * [HomeSpan User Guide](UserGuide.md) - turnkey instructions on how to configure an already-programmed HomeSpan device's WiFi Credentials, modify its HomeKit Setup Code, and pair the device to HomeKit. No computer needed! * [HomeSpan API Reference](Reference.md) - a complete guide to the HomeSpan Library API -* [HomeSpan Extras](Extras.md) - integrated access to the ESP32's on-chip PWM and Remote Control peripherals :construction: +* [HomeSpan Extras](Extras.md) - integrated access to the ESP32's on-chip PWM and Remote Control peripherals! :construction: # External Resources From d1301e46127b11dca20233ac3766a56cd98ee851 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 13:54:37 -0600 Subject: [PATCH 10/18] Update Extras.md --- docs/Extras.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/Extras.md b/docs/Extras.md index ae1c419..629d189 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -2,6 +2,11 @@ HomeSpan includes integrated access to a number of ESP32 features you'll likely find particularly useful when constructing your HomeSpan devices. +## Pulse Width Modulation (PWM) + +PWM on the ESP32 is more flexible, but slighly more complicated, than PWM on most Arduino devices (like the Uno or Mega). On the ESP32, you use one of 16 built-in timers to create a PWM signal, and then link that channel to any ESP32 pin. + + --- [↩️](README.md) Back to the Welcome page From 93647788b51bae36c20380e950531551511342dd Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 16:59:12 -0600 Subject: [PATCH 11/18] Update Extras.md --- docs/Extras.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/Extras.md b/docs/Extras.md index 629d189..6bd21e1 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -4,8 +4,21 @@ HomeSpan includes integrated access to a number of ESP32 features you'll likely ## Pulse Width Modulation (PWM) -PWM on the ESP32 is more flexible, but slighly more complicated, than PWM on most Arduino devices (like the Uno or Mega). On the ESP32, you use one of 16 built-in timers to create a PWM signal, and then link that channel to any ESP32 pin. +PWM on the ESP32 is more flexible, but slighly more complicated, than PWM on most Arduino devices (like the Uno or Mega). On the ESP32, you use one of 16 built-in timer-channels to create a PWM signal, and then link that channel to any ESP32 pin. HomeSpan includes a library that makes this very easy, and is accessed as follows: +`#include "extras/PwmPin.h"` + +### *PwmPin(uint8_t channel, uint8_t pin)* + +Creating an instance of this class links one of 16 timer-channels to an ESP32 pin. + +* *channel* - an ESP32 timer-channel number (0-15) which will generate the PWM signal +* *pin* - the ESP32 pin that will output the PWM signal produced by the channel + +The following methods are supported: + +* `void set(uint8_t channel, uint8_t level)` + * sets that PWM duty cycle or timer-channel *channel* to *level*, where *level* ranges from 0 (off) to 100 (steady on) --- From 1230fda3d5688f39146af907cefde68b36d222e5 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 17:00:07 -0600 Subject: [PATCH 12/18] Update Extras.md --- docs/Extras.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Extras.md b/docs/Extras.md index 6bd21e1..26202e7 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -18,7 +18,7 @@ Creating an instance of this class links one of 16 timer-channels to an ESP32 pi The following methods are supported: * `void set(uint8_t channel, uint8_t level)` - * sets that PWM duty cycle or timer-channel *channel* to *level*, where *level* ranges from 0 (off) to 100 (steady on) + * sets that PWM %duty-cycle of timer-channel *channel* to *level*, where *level* ranges from 0 (off) to 100 (steady on) --- From 3317be0811ad62be1b158527ac07a3fc1e5f38e7 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 17:00:40 -0600 Subject: [PATCH 13/18] Update Extras.md --- docs/Extras.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Extras.md b/docs/Extras.md index 26202e7..91cd8fc 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -18,6 +18,7 @@ Creating an instance of this class links one of 16 timer-channels to an ESP32 pi The following methods are supported: * `void set(uint8_t channel, uint8_t level)` + * sets that PWM %duty-cycle of timer-channel *channel* to *level*, where *level* ranges from 0 (off) to 100 (steady on) --- From 33e9d19670c044e89724f64a186014a6834ba9ae Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 17:00:54 -0600 Subject: [PATCH 14/18] Update Extras.md --- docs/Extras.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Extras.md b/docs/Extras.md index 91cd8fc..5c748ec 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -19,7 +19,7 @@ The following methods are supported: * `void set(uint8_t channel, uint8_t level)` - * sets that PWM %duty-cycle of timer-channel *channel* to *level*, where *level* ranges from 0 (off) to 100 (steady on) + * sets the PWM %duty-cycle of timer-channel *channel* to *level*, where *level* ranges from 0 (off) to 100 (steady on) --- From a0c0c1af13a57ecc6dc24a7a882e6021c25fe540 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 22:19:21 -0600 Subject: [PATCH 15/18] Update Extras.md --- docs/Extras.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/Extras.md b/docs/Extras.md index 5c748ec..643b538 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -10,17 +10,37 @@ PWM on the ESP32 is more flexible, but slighly more complicated, than PWM on mos ### *PwmPin(uint8_t channel, uint8_t pin)* -Creating an instance of this class links one of 16 timer-channels to an ESP32 pin. +Creating an instance of this **class** links one of 16 timer-channels to an ESP32 pin. -* *channel* - an ESP32 timer-channel number (0-15) which will generate the PWM signal +* *channel* - the ESP32 timer-channel number (0-15) to generate the PWM signal * *pin* - the ESP32 pin that will output the PWM signal produced by the channel The following methods are supported: * `void set(uint8_t channel, uint8_t level)` - * sets the PWM %duty-cycle of timer-channel *channel* to *level*, where *level* ranges from 0 (off) to 100 (steady on) + * sets the PWM %duty-cycle of timer-channel *channel* (0-15) to *level*, where *level* ranges from 0 (off) to 100 (steady on) + +* `int getPin()` + * returns the pin number + +PwmPin also includes a static class function that converts Hue/Saturation/Brightness values (typically used by HomeKit) to Red/Green/Blue values (ypically used to control multi-color LEDS). + +* `static void HSVtoRGB(float h, float s, float v, float *r, float *g, float *b)` + + * *h* - input Hue value, range 0-360 + * *s* - input Saturation value, range 0-1 + * *v* - input Brightness value, range 0-1 + * *r* - output Red value, range 0-1 + * *g* - output Green value, range 0-1 + * *b* - output Blue value, range 0-1 + +See tutorial sketch [10 (RGB_LED)](../examples/10-RGB_LED) for an example of using PwmPin to control an RGB LED. + + + + --- [↩️](README.md) Back to the Welcome page From 6a87dc4f4e7ddcc37350c03011d160dd27b2d059 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 22:23:01 -0600 Subject: [PATCH 16/18] Update Extras.md --- docs/Extras.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Extras.md b/docs/Extras.md index 643b538..968f93f 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -25,7 +25,7 @@ The following methods are supported: * returns the pin number -PwmPin also includes a static class function that converts Hue/Saturation/Brightness values (typically used by HomeKit) to Red/Green/Blue values (ypically used to control multi-color LEDS). +PwmPin also includes a static class function that converts Hue/Saturation/Brightness values (typically used by HomeKit) to Red/Green/Blue values (typically used to control multi-color LEDS). * `static void HSVtoRGB(float h, float s, float v, float *r, float *g, float *b)` @@ -36,8 +36,9 @@ PwmPin also includes a static class function that converts Hue/Saturation/Bright * *g* - output Green value, range 0-1 * *b* - output Blue value, range 0-1 -See tutorial sketch [10 (RGB_LED)](../examples/10-RGB_LED) for an example of using PwmPin to control an RGB LED. +See tutorial sketch [#10 (RGB_LED)](../examples/10-RGB_LED) for an example of using PwmPin to control an RGB LED. +## Radio Frequency / Infrared Signal Generation From 8f2fdc8a1547b91ceac056a330409fead8941086 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 22:47:21 -0600 Subject: [PATCH 17/18] Update Extras.md --- docs/Extras.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/Extras.md b/docs/Extras.md index 968f93f..46a09b0 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -40,6 +40,24 @@ See tutorial sketch [#10 (RGB_LED)](../examples/10-RGB_LED) for an example of us ## Radio Frequency / Infrared Signal Generation +The ESP32 has an on-chip signal-generator peripheral designed to drive an RF or IR transmitter. HomeSpan includes an easy-to-use library that interfaces with this peripheral so that with a few additional electronic components you can create a HomeSpan device that controls an RF or IR appliance directly from the Home App on your iPhone, or via Siri. The library is accessed as follows: + +`#include "extras/RFControl.h"` + +### *RFControl(int pin)* + +Creating an instance of this **class** initializes the RF/IR signal generator and specifies the ESP32 output *pin*. You may create more than once instance of this class if driving more than one RF/IR transmitter (each connected to different *pin*). + +The following methods are supported: + +(to be continued) + + + + + + + --- From 2376fe9d3d431363f310e4fde3eb42106fb41d3c Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 26 Nov 2020 22:49:05 -0600 Subject: [PATCH 18/18] Update Extras.md --- docs/Extras.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Extras.md b/docs/Extras.md index 46a09b0..c09ad72 100644 --- a/docs/Extras.md +++ b/docs/Extras.md @@ -46,7 +46,7 @@ The ESP32 has an on-chip signal-generator peripheral designed to drive an RF or ### *RFControl(int pin)* -Creating an instance of this **class** initializes the RF/IR signal generator and specifies the ESP32 output *pin*. You may create more than once instance of this class if driving more than one RF/IR transmitter (each connected to different *pin*). +Creating an instance of this **class** initializes the RF/IR signal generator and specifies the ESP32 *pin* to output the signal. You may create more than one instance of this class if driving more than one RF/IR transmitter (each connected to different *pin*). The following methods are supported: