mirror of
https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library.git
synced 2026-03-11 18:47:07 +01:00
Update TFTeSPI examples
This commit is contained in:
@@ -8,16 +8,16 @@ TTGOClass *ttgo;
|
||||
void pressed()
|
||||
{
|
||||
uint16_t color = random(0xFFFF);
|
||||
ttgo->eTFT->fillScreen(color);
|
||||
ttgo->eTFT->setTextColor(color, TFT_WHITE);
|
||||
ttgo->eTFT->drawString("User Button pressed", 5, 100, 4);
|
||||
ttgo->tft->fillScreen(color);
|
||||
ttgo->tft->setTextColor(color, TFT_WHITE);
|
||||
ttgo->tft->drawString("User Button pressed", 5, 100, 4);
|
||||
}
|
||||
void released()
|
||||
{
|
||||
uint16_t color = random(0xFFFF);
|
||||
ttgo->eTFT->fillScreen(color);
|
||||
ttgo->eTFT->setTextColor(color, TFT_WHITE);
|
||||
ttgo->eTFT->drawString("User Button released", 5, 100, 4);
|
||||
ttgo->tft->fillScreen(color);
|
||||
ttgo->tft->setTextColor(color, TFT_WHITE);
|
||||
ttgo->tft->drawString("User Button released", 5, 100, 4);
|
||||
}
|
||||
|
||||
void setup()
|
||||
@@ -27,10 +27,10 @@ void setup()
|
||||
ttgo->begin();
|
||||
ttgo->openBL();
|
||||
|
||||
ttgo->eTFT->fillScreen(TFT_BLACK);
|
||||
ttgo->eTFT->setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
ttgo->eTFT->setTextFont(4);
|
||||
ttgo->eTFT->drawString("User Button released", 5, 100, 4);
|
||||
ttgo->tft->fillScreen(TFT_BLACK);
|
||||
ttgo->tft->setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
ttgo->tft->setTextFont(4);
|
||||
ttgo->tft->drawString("User Button released", 5, 100, 4);
|
||||
|
||||
ttgo->button->setPressedHandler(pressed);
|
||||
ttgo->button->setReleasedHandler(released);
|
||||
|
||||
Reference in New Issue
Block a user