This commit is contained in:
2022-01-04 15:50:20 +01:00
parent ec47ddc402
commit 14b25a9459
10 changed files with 125 additions and 134 deletions

View File

@@ -6,6 +6,7 @@ bool ledstate = false;
bool blinkState = false;
CRGB ledcolor = CRGB::Black;
uint32_t lastLedTime = 0;
uint32_t lastBlinkTime = 0;
void setLedBlink(bool blink)
{
@@ -36,7 +37,7 @@ void handleLed(void)
uint32_t timeNow = millis();
if (timeNow - lastLedTime > LEDTIMEOUT)
{
if (blinkState)
if (blinkState && (timeNow - lastBlinkTime > LEDBLINKTIME))
{
if (!ledstate)
{
@@ -47,46 +48,12 @@ void handleLed(void)
leds[0] = ledcolor;
}
ledstate = !ledstate;
lastBlinkTime = timeNow;
}
else
{
leds[0] = ledcolor;
}
// if (ledstate)
// {
// if (getPowerState() == POWERSTATES::on)
// {
// if(getAudioState())
// {
// leds[0] = CRGB::Purple;
// }
// else if( getRFIDlastUID() != "")
// {
// leds[0] = CRGB::Yellow;
// }
// else
// {
// leds[0] = CRGB::Green;
// }
// }
// else if (getPowerState() == POWERSTATES::poweringOn2)
// {
// leds[0] = CRGB::Blue;
// }
// else if (getPowerState() == POWERSTATES::poweringOff2)
// {
// leds[0] = CRGB::Orange;
// }
// else
// {
// leds[0] = CRGB::Red;
// }
// }
// else
// {
// leds[0] = CRGB::Black;
// }
FastLED.show();
lastLedTime = timeNow;
}