#define LILYGO_WATCH_2020_V2
#include <LilyGoWatch.h>
#include <soc/rtc.h>
TTGOClass *ttgo;
void setup(){
ttgo = TTGOClass::getWatch();
ttgo->begin();
ttgo->tft->setTextFont(8);
ttgo->tft->fillScreen(TFT_BLACK);
ttgo->tft->setTextColor(TFT_WHITE, TFT_BLACK);
ttgo->openBL();
}
int count = 0;
int16_t x,y;
void loop(){
ttgo->tft->setCursor(50, 80);
ttgo->tft->print(count);
while(!ttgo->getTouch(x,y)){}
unsigned long t = millis();
int y0 = y;
while(ttgo->getTouch(x,y)){
if(millis() - t > 1000){
count = -1;
ttgo->tft->fillScreen(TFT_BLACK);
}
}
if(y0 - y > 50){
count += 10;
}
count += 1;
}
Comments
Please log in or sign up to comment.