mirror of
https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library.git
synced 2026-03-03 06:44:10 +01:00
31 lines
608 B
C++
31 lines
608 B
C++
|
|
#include "config.h"
|
|
|
|
TTGOClass *ttgo;
|
|
|
|
void setup()
|
|
{
|
|
Serial.begin(115200);
|
|
ttgo = TTGOClass::getWatch();
|
|
ttgo->begin();
|
|
ttgo->openBL();
|
|
|
|
//! begin motor attach to 33 pin , In TWatch-2020 it is IO4
|
|
ttgo->motor_begin();
|
|
|
|
ttgo->tft->fillScreen(TFT_BLACK);
|
|
ttgo->tft->setTextColor(TFT_WHITE, TFT_BLACK);
|
|
ttgo->tft->drawString("Please touch screen", 50, 100, 2);
|
|
|
|
//attach touch screen interrupt pin
|
|
pinMode(TP_INT, INPUT);
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
if (digitalRead(TP_INT) == LOW) {
|
|
ttgo->motor->onec();
|
|
delay(200);
|
|
}
|
|
}
|