mirror of
https://github.com/gunner47/GyverLamp.git
synced 2025-08-08 09:20:59 +03:00
Добавлены изменения из прошивка от Alex Gyver v1.5: бегущая строка с IP адресом лампы по пятикратному клику на кнопку
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user