From f3a5b90d090fda687adad44e37200fa446fcf7e0 Mon Sep 17 00:00:00 2001 From: EnricoGuccii Date: Sun, 11 May 2025 19:11:37 +0200 Subject: add motors --- lib/rgb/rgb.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/rgb/rgb.cpp') 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); -- cgit v1.2.3