Converted initial level of LedPin from uint8_t to float

This commit is contained in:
Gregg 2021-09-13 06:02:20 -05:00
parent 98a5a895cc
commit 3ea8f956a5
4 changed files with 2 additions and 2 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
src/.DS_Store vendored

Binary file not shown.

View File

@ -47,7 +47,7 @@ LedC::LedC(uint8_t pin, uint16_t freq){
///////////////////
LedPin::LedPin(uint8_t pin, uint8_t level, uint16_t freq) : LedC(pin, freq){
LedPin::LedPin(uint8_t pin, float level, uint16_t freq) : LedC(pin, freq){
if(!channel)
Serial.printf("\n*** ERROR: Can't create LedPin(%d) - no open PWM channels and/or Timers ***\n\n",pin);

View File

@ -51,7 +51,7 @@ class LedC {
class LedPin : public LedC {
public:
LedPin(uint8_t pin, uint8_t level=0, uint16_t freq=DEFAULT_PWM_FREQ); // assigns pin to be output of one of 16 PWM channels initial level and frequency
LedPin(uint8_t pin, float level=0, uint16_t freq=DEFAULT_PWM_FREQ); // assigns pin to be output of one of 16 PWM channels initial level and frequency
void set(float level); // sets the PWM duty to level (0-100)
static void HSVtoRGB(float h, float s, float v, float *r, float *g, float *b ); // converts Hue/Saturation/Brightness to R/G/B