From 57fef4b49676dcb5feea9d9361b1582633f8fade Mon Sep 17 00:00:00 2001 From: Gregg Date: Sat, 25 Jul 2020 20:47:05 -0500 Subject: [PATCH] Create /extras folder Created /extras folder and moved PwmPin and RFControl files from src into src/extras. --- examples/Intermediate/6-DimmableLED/6-DimmableLED.ino | 2 +- examples/Intermediate/6-DimmableLED/DEV_LED.h | 4 ++-- src/{ => extras}/PwmPin.cpp | 0 src/{ => extras}/PwmPin.h | 0 src/{ => extras}/RFControl.cpp | 0 src/{ => extras}/RFControl.h | 0 src/extras/extras.ino | 5 +++++ 7 files changed, 8 insertions(+), 3 deletions(-) rename src/{ => extras}/PwmPin.cpp (100%) rename src/{ => extras}/PwmPin.h (100%) rename src/{ => extras}/RFControl.cpp (100%) rename src/{ => extras}/RFControl.h (100%) create mode 100644 src/extras/extras.ino diff --git a/examples/Intermediate/6-DimmableLED/6-DimmableLED.ino b/examples/Intermediate/6-DimmableLED/6-DimmableLED.ino index fdfb7d0..38e68dc 100644 --- a/examples/Intermediate/6-DimmableLED/6-DimmableLED.ino +++ b/examples/Intermediate/6-DimmableLED/6-DimmableLED.ino @@ -29,7 +29,7 @@ void setup() { // you can download that mimics or reproduces analogWrite() in some form or another. HomeSpan conveniently comes with // it own version of a wrapper around the ESP32 PWM classes that make it very easy to define PWM "channel," attach a pin, // and set the PWM level (or duty cycle) from 0-100%. These functions are encapsualted in the PwmPin class, as defined in - // PwmPin.h. We will include this file in our updated DEV_LED.h for use with DEV_DimmableLED. + // extras/PwmPin.h. We will include this file in our updated DEV_LED.h for use with DEV_DimmableLED. Serial.begin(115200); diff --git a/examples/Intermediate/6-DimmableLED/DEV_LED.h b/examples/Intermediate/6-DimmableLED/DEV_LED.h index 0b2ce94..efb505f 100644 --- a/examples/Intermediate/6-DimmableLED/DEV_LED.h +++ b/examples/Intermediate/6-DimmableLED/DEV_LED.h @@ -3,7 +3,7 @@ // DEVICE-SPECIFIC LED SERVICES // //////////////////////////////////// -#include "PwmPin.h" // NEW! Include this HomeSpan "extra" to create LED-compatible PWM signals on one or more pins +#include "extras/PwmPin.h" // NEW! Include this HomeSpan "extra" to create LED-compatible PWM signals on one or more pins struct DEV_LED : Service::LightBulb { // ON/OFF LED @@ -58,7 +58,7 @@ struct DEV_DimmableLED : Service::LightBulb { // Dimmable LED // request the LED be turned off, but retain the brightness level so that it does not need to be resent if // the LED is turned back on. Multiplying the newValue of the power Characteristic (as a boolean) with the // newValue of the Brightness Characteristic (as an int) is a short-hand way of creating the logic to - // determing the PWM level when the LED is off (always zero) or on (whatever the brightness level is). + // set the PWM level when the LED is off (always zero) or on (whatever the brightness level is). pwmPin->set(channel,power->newValue.BOOL*level->newValue.INT); diff --git a/src/PwmPin.cpp b/src/extras/PwmPin.cpp similarity index 100% rename from src/PwmPin.cpp rename to src/extras/PwmPin.cpp diff --git a/src/PwmPin.h b/src/extras/PwmPin.h similarity index 100% rename from src/PwmPin.h rename to src/extras/PwmPin.h diff --git a/src/RFControl.cpp b/src/extras/RFControl.cpp similarity index 100% rename from src/RFControl.cpp rename to src/extras/RFControl.cpp diff --git a/src/RFControl.h b/src/extras/RFControl.h similarity index 100% rename from src/RFControl.h rename to src/extras/RFControl.h diff --git a/src/extras/extras.ino b/src/extras/extras.ino new file mode 100644 index 0000000..8d8b76d --- /dev/null +++ b/src/extras/extras.ino @@ -0,0 +1,5 @@ + +#error THIS IS NOT COMPILABLE CODE + +This is a dummy .ino file that allows you to easily edit the contents of this library using the Arduino IDE. +The code is NOT designed to be compiled from this point. Compile and test the library using one of the examples.