implement screen blink

1.2-legacy
Charles Crossan 2020-12-20 17:45:45 -05:00
rodzic 7205e9a5b4
commit db2193b526
3 zmienionych plików z 27 dodań i 2 usunięć

Wyświetl plik

@ -894,6 +894,27 @@ void Screen::handleStartBluetoothPinScreen(uint32_t pin)
setFastFramerate();
}
void Screen::blink() {
setFastFramerate();
uint8_t count = 10;
uint8_t blinker = 0;
dispdev.setBrightness(254);
while(count>0) {
if (blinker == 254) {
blinker = 0;
count--;
} else {
blinker++;
}
int width = blinker / (254.00 / SCREEN_WIDTH);
dispdev.fillRect(0, 0, width, SCREEN_HEIGHT);
dispdev.display();
}
dispdev.setBrightness(brightness);
}
void Screen::handlePrint(const char *text)
{
DEBUG_MSG("Screen: %s", text);

Wyświetl plik

@ -107,6 +107,8 @@ class Screen : public concurrency::OSThread
*/
void doDeepSleep();
void blink();
/// Handles a button press.
void onPress() { enqueueCmd(ScreenCmd{.cmd = Cmd::ON_PRESS}); }

Wyświetl plik

@ -986,14 +986,16 @@ void handleBlinkLED(HTTPRequest *req, HTTPResponse *res)
uint8_t count = 10;
while (count > 0)
/*while (count > 0)
{
setLed(true);
delay(50);
setLed(false);
delay(50);
count = count - 1;
}
}*/
screen->blink();
}
void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)