This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PCF8563_Class(I2CBus &bus, uint8_t addr = PCF8563_SLAVE_ADDRESS); | |
| void check(); // Compares compile time with RTC | |
| void setDateTime(uint16_t year, | |
| uint8_t month, | |
| uint8_t day, | |
| uint8_t hour, | |
| uint8_t minute, | |
| uint8_t second); | |
| void setDateTime(RTC_Date date); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RTC_Date | |
| { | |
| public: | |
| RTC_Date(); | |
| RTC_Date(const char *date, const char *time); | |
| RTC_Date(uint16_t year, | |
| uint8_t month, | |
| uint8_t day, | |
| uint8_t hour, | |
| uint8_t minute, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TTGOClass *ttgo; | |
| bool rtcIrq = false; | |
| void setup() { | |
| ttgo = TTGOClass::getWatch(); | |
| ttgo->begin(); | |
| ttgo->openBL(); | |
| pinMode(RTC_INT_PIN, INPUT_PULLUP); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int chargeOffset = map(batSOC, 0, 100, 0, 17); | |
| // Draw Battery Charged Icon | |
| ttgo->tft->fillRect(150, 0, 20, 10, TFT_GREEN); | |
| ttgo->tft->fillRect(146, 3, 4, 4, TFT_GREEN); | |
| ttgo->tft->fillRect(152, 2, 16 - chargeOffset, 6, TFT_BLACK); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| ttgo = TTGOClass::getWatch(); | |
| ttgo->begin(); | |
| ttgo->openBL(); // Turn on the backlight | |
| //Turn on AXP202 ADC so the PMU can monitor | |
| ttgo->power->adc1Enable(AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_BATT_VOL_ADC1, true); | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ttgo->tft->setTextSize(2); | |
| ttgo->tft->setCursor(0, 0); | |
| ttgo->tft->setTextColor(TFT_YELLOW); | |
| ttgo->tft->print("Reefwing Software"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #define TFT_WIDTH 240 | |
| #define TFT_HEIGHT 240 | |
| #define TWATCH_TFT_MISO (gpio_num_t)0 | |
| #define TWATCH_TFT_MOSI (gpio_num_t)19 | |
| #define TWATCH_TFT_SCLK (gpio_num_t)18 | |
| #define TWATCH_TFT_CS (gpio_num_t)5 | |
| #define TWATCH_TFT_DC (gpio_num_t)27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Extract from LilyGoWatch.h... | |
| #elif defined(LILYGO_WATCH_2020_V1) | |
| #include "board/twatch2020_v1.h" | |
| // Has | |
| #define LILYGO_WATCH_HAS_TOUCH // ->getTouch() defined | |
| #define LILYGO_WATCH_HAS_DISPLAY // ->tft defined | |
| #define LILYGO_WATCH_HAS_BUZZER | |
| #define LILYGO_WATCH_HAS_MOTOR // ->motor_begin() & shake() | |
| #define LILYGO_WATCH_HAS_PCF8563 // ->rtc defined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // => Hardware select | |
| // #define LILYGO_WATCH_2019_WITH_TOUCH // To use T-Watch2019 with touchscreen, please uncomment this line | |
| // #define LILYGO_WATCH_2019_NO_TOUCH // To use T-Watch2019 Not touchscreen , please uncomment this line | |
| #define LILYGO_WATCH_2020_V1 // To use T-Watch2020 V1, please uncomment this line | |
| // #define LILYGO_WATCH_2020_V2 // To use T-Watch2020 V2, please uncomment this line | |
| // #define LILYGO_WATCH_2020_V3 // To use T-Watch2020 V3, please uncomment this line | |
| // #define LILYGO_LILYPI_V1 //LILYPI / TBLOCK requires an external display module | |
| // #define LILYGO_WATCH_BLOCK //LILYPI / TBLOCK requires an external display module | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "config.h" | |
| #include <soc/rtc.h> | |
| TTGOClass *ttgo; | |
| void setup() { | |
| ttgo = TTGOClass::getWatch(); | |
| ttgo->begin(); | |
| } |