Use red led to visualize button presses
This commit is contained in:
parent
e3fe70dff2
commit
6af6a6ac76
@ -209,6 +209,7 @@ void onHomieEvent(const HomieEvent &event)
|
|||||||
digitalWrite(WITTY_RGB_R, LOW);
|
digitalWrite(WITTY_RGB_R, LOW);
|
||||||
if (!i2cEnable.get()) { /** keep green LED activated to power I2C sensor */
|
if (!i2cEnable.get()) { /** keep green LED activated to power I2C sensor */
|
||||||
digitalWrite(WITTY_RGB_G, LOW);
|
digitalWrite(WITTY_RGB_G, LOW);
|
||||||
|
log(MQTT_LEVEL_INFO, F("I2C powersupply deactivated"), MQTT_LOG_I2CINIT);
|
||||||
}
|
}
|
||||||
digitalWrite(WITTY_RGB_B, LOW);
|
digitalWrite(WITTY_RGB_B, LOW);
|
||||||
strip.fill(strip.Color(0,0,128));
|
strip.fill(strip.Color(0,0,128));
|
||||||
@ -227,6 +228,9 @@ void onHomieEvent(const HomieEvent &event)
|
|||||||
case HomieEventType::OTA_SUCCESSFUL:
|
case HomieEventType::OTA_SUCCESSFUL:
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
break;
|
break;
|
||||||
|
case HomieEventType::WIFI_CONNECTED:
|
||||||
|
digitalWrite(WITTY_RGB_B, HIGH);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -440,7 +444,6 @@ void setup()
|
|||||||
strip.setPixelColor(0, strip.Color(0,0,128));
|
strip.setPixelColor(0, strip.Color(0,0,128));
|
||||||
}
|
}
|
||||||
strip.show();
|
strip.show();
|
||||||
digitalWrite(WITTY_RGB_B, HIGH);
|
|
||||||
} else {
|
} else {
|
||||||
digitalWrite(WITTY_RGB_R, HIGH);
|
digitalWrite(WITTY_RGB_R, HIGH);
|
||||||
strip.fill(strip.Color(128,0,0));
|
strip.fill(strip.Color(128,0,0));
|
||||||
@ -470,6 +473,7 @@ void loop()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mButtonPressed=0U;
|
mButtonPressed=0U;
|
||||||
|
digitalWrite(WITTY_RGB_R, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mButtonPressed > BUTTON_MAX_CYCLE) {
|
if (mButtonPressed > BUTTON_MAX_CYCLE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user