Swipe backwards

This commit is contained in:
Martin Bauer
2021-11-19 17:28:48 +01:00
parent aa76900244
commit 0bbb5d278c
3 changed files with 31 additions and 15 deletions

View File

@@ -22,6 +22,7 @@ Esp32DriverRGBW ledDriver;
LedTask<decltype(ledStrip)> ledTask;
bool fox;
void tag_handler(uint8_t *sn)
{
// serial number is always 5 bytes long
@@ -33,19 +34,27 @@ void tag_handler(uint8_t *sn)
if (sn[4] == 0x30)
{
Serial.println("Fuchs");
fox = true;
//ledTask.startEffect(EffectCircularConfig{2 * 360, 180, ColorRGBW{0, 0, 255, 0}});
ledTask.startEffect(EffectAlexaSwipeConfig{20, 30, 3 * 360, 3, 180, ColorRGBW{0, 255, 0, 0}, ColorRGBW{0, 0, 255, 0}});
ledTask.startEffect(EffectAlexaSwipeConfig{20, 30, 3 * 360, 3, 180, true, ColorRGBW{0, 255, 0, 0}, ColorRGBW{0, 0, 255, 0}});
}
if (sn[4] == 0xf0)
{
Serial.println("Eule");
fox = false;
ledTask.startEffect(EffectCircularConfig{360, 180, ColorRGBW{0, 0, 255, 0}});
}
}
else
{
Serial.println("Nichts");
ledTask.startEffect(EffectStaticConfig{ColorRGBW{0, 0, 0, 0}});
if (fox)
{
fox = false;
ledTask.startEffect(EffectAlexaSwipeConfig{20, 30, 3 * 360, 3, 180, false, ColorRGBW{0, 255, 0, 0}, ColorRGBW{0, 0, 255, 0}});
}
else
ledTask.startEffect(EffectStaticConfig{ColorRGBW{0, 0, 0, 0}});
}
//led.transmit();
}