diff --git a/examples/06-DimmableLED/06-DimmableLED.ino b/examples/06-DimmableLED/06-DimmableLED.ino index f81ea0f..804b116 100644 --- a/examples/06-DimmableLED/06-DimmableLED.ino +++ b/examples/06-DimmableLED/06-DimmableLED.ino @@ -53,8 +53,8 @@ void setup() { // output to drive the brightness of an LED. The ESP32 code base itself includes a set of functions to create PWM output // and the ESP32 chip has built-in PWM functionality specifically for this purpose. There are numerous libraries // 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 LedPin class, as defined in + // its own version of a wrapper around the ESP32 PWM classes that make it very easy to define LED pins, and set the + // PWM level (or duty cycle) from 0-100%. These functions are encapsualted in the LedPin class, as defined in // 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/10-RGB_LED/DEV_LED.h b/examples/10-RGB_LED/DEV_LED.h index 833b8ad..480f3ce 100644 --- a/examples/10-RGB_LED/DEV_LED.h +++ b/examples/10-RGB_LED/DEV_LED.h @@ -182,7 +182,7 @@ struct DEV_RgbLED : Service::LightBulb { // RGB LED (Command Cathode) sprintf(cBuf,"RGB=(%d,%d,%d)\n",R,G,B); LOG1(cBuf); - redPin->set(R); // update the ledPin channels with new values + redPin->set(R); // update each ledPin with new values greenPin->set(G); bluePin->set(B); diff --git a/examples/15-RealPushButtons/DEV_LED.h b/examples/15-RealPushButtons/DEV_LED.h index 1f03838..93a3657 100644 --- a/examples/15-RealPushButtons/DEV_LED.h +++ b/examples/15-RealPushButtons/DEV_LED.h @@ -20,7 +20,6 @@ struct DEV_DimmableLED : Service::LightBulb { // Dimmable LED int powerPin; // NEW! pin with pushbutton to turn on/off LED int raisePin; // NEW! pin with pushbutton to increase brightness int lowerPin; // NEW! pin with pushButton to decrease brightness - int channel; // PWM channel used for this LED (should be unique for each LED) SpanCharacteristic *power; // reference to the On Characteristic SpanCharacteristic *level; // reference to the Brightness Characteristic int favoriteLevel=50; // NEW! keep track of a 'favorite' level @@ -53,8 +52,6 @@ struct DEV_DimmableLED : Service::LightBulb { // Dimmable LED Serial.print("Configuring Dimmable LED: Pin="); // initialization message Serial.print(ledPin->getPin()); - Serial.print(" Channel="); - Serial.print(channel); Serial.print("\n"); } // end constructor diff --git a/src/src/extras/PwmPin.cpp b/src/src/extras/PwmPin.cpp index d5eab95..d39b704 100644 --- a/src/src/extras/PwmPin.cpp +++ b/src/src/extras/PwmPin.cpp @@ -85,7 +85,7 @@ LedPin::LedPin(uint8_t pin, float level, uint16_t freq, boolean invert) : LedC(p if(!channel) Serial.printf("\n*** ERROR: Can't create LedPin(%d) - no open PWM channels and/or Timers ***\n\n",pin); else - Serial.printf("LedPin=%d: mode=%d channel=%d, timer=%d, freq=%d Hz, resolution=%d bits %s\n", + Serial.printf("LedPin=%d: mode=%d, channel=%d, timer=%d, freq=%d Hz, resolution=%d bits %s\n", channel->gpio_num, channel->speed_mode, channel->channel,