diff options
Diffstat (limited to 'lib/rgb/rgb.cpp')
| -rw-r--r-- | lib/rgb/rgb.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rgb/rgb.cpp b/lib/rgb/rgb.cpp index 249e7f0..e66d264 100644 --- a/lib/rgb/rgb.cpp +++ b/lib/rgb/rgb.cpp @@ -14,8 +14,12 @@ int RGB::scaleColor(uint8_t val) { return map(val, 0, 255, 0, (1 << PWM_RES) - 1); } - RGB::RGB() + : currentR(0), currentG(0), currentB(0) +{ +} + +void RGB::init() { ledcSetup(RED_CHANNEL, PWM_FREQ, PWM_RES); ledcAttachPin(RED_PIN, RED_CHANNEL); |