mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-30 18:49:09 +03:00
implements #2848
This commit is contained in:
@@ -289,11 +289,7 @@ void AnalogSensor::reload(bool get_nvs) {
|
||||
uint8_t r = v / 10000;
|
||||
uint8_t g = (v - r * 10000) / 100;
|
||||
uint8_t b = v % 100;
|
||||
#if ESP_ARDUINO_VERSION_MAJOR < 3
|
||||
neopixelWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
|
||||
#else
|
||||
rgbLedWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
|
||||
#endif
|
||||
EMSESP_RGB_WRITE(sensor.gpio(), 2 * r, 2 * g, 2 * b);
|
||||
LOG_DEBUG("RGB set to %d, %d, %d", r, g, b);
|
||||
} else if (sensor.type() == AnalogType::DIGITAL_OUT) {
|
||||
LOG_DEBUG("Digital Write on GPIO %02d", sensor.gpio());
|
||||
@@ -955,11 +951,7 @@ bool AnalogSensor::command_setvalue(const char * value, const int8_t gpio) {
|
||||
uint8_t r = v / 10000;
|
||||
uint8_t g = (v - r * 10000) / 100;
|
||||
uint8_t b = v % 100;
|
||||
#if ESP_ARDUINO_VERSION_MAJOR < 3
|
||||
neopixelWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
|
||||
#else
|
||||
rgbLedWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
|
||||
#endif
|
||||
EMSESP_RGB_WRITE(sensor.gpio(), 2 * r, 2 * g, 2 * b);
|
||||
LOG_DEBUG("RGB set to %d, %d, %d", r, g, b);
|
||||
} else if (sensor.type() == AnalogType::PULSE) {
|
||||
uint8_t v = val;
|
||||
|
||||
Reference in New Issue
Block a user