Update TFTeSPI examples

This commit is contained in:
lewis he
2020-06-23 17:36:15 +08:00
parent 914442a735
commit ecbdb78fe4
42 changed files with 1519 additions and 1470 deletions

View File

@@ -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);