Добавлены изменения из прошивка от Alex Gyver v1.5: бегущая строка с IP адресом лампы по пятикратному клику на кнопку

This commit is contained in:
gunner47
2019-09-24 21:54:13 +03:00
parent 8277bd8aac
commit d0c21ce902
4 changed files with 393 additions and 5 deletions

View File

@@ -4,8 +4,9 @@ bool brightDirection;
void buttonTick()
{
touch.tick();
uint8_t clickCount = touch.hasClicks() ? touch.getClicks() : 0;
if (touch.isSingle())
if (clickCount == 1)
{
if (dawnFlag)
{
@@ -24,7 +25,7 @@ void buttonTick()
loadingFlag = true;
}
if (ONflag && touch.isDouble())
if (ONflag && clickCount == 2)
{
if (++currentMode >= MODE_AMOUNT) currentMode = 0;
FastLED.setBrightness(modes[currentMode].Brightness);
@@ -35,7 +36,7 @@ void buttonTick()
delay(1);
}
if (ONflag && touch.isTriple())
if (ONflag && clickCount == 3)
{
if (--currentMode < 0) currentMode = MODE_AMOUNT - 1;
FastLED.setBrightness(modes[currentMode].Brightness);
@@ -46,7 +47,7 @@ void buttonTick()
delay(1);
}
if (ONflag && touch.hasClicks() && touch.getClicks() >= 4)
if (ONflag && clickCount == 4)
{
#ifdef OTA
if (otaManager.RequestOtaUpdate())
@@ -58,6 +59,14 @@ void buttonTick()
#endif
}
if (ONflag && clickCount == 5) // вывод IP на лампу
{
if (ESP_MODE == 1U)
{
while(!fillString(WiFi.localIP().toString().c_str())) delay(1);
}
}
if (ONflag && touch.isHolded())
{
brightDirection = !brightDirection;