/*
Simple "Hello World" for ILI9341 LCD
https://wokwi.com/arduino/projects/308024602434470466
*/
#include "RTClib.h"
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
RTC_Millis rtc;
void setup() {
rtc.begin(DateTime(F(__DATE__), F(__TIME__)));
tft.begin();
tft.setRotation(3);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
//tft.setCursor(20, 160);
//tft.setTextColor(ILI9341_GREEN);
//tft.setTextSize(2);
//tft.println("I can has colors?");
// Meme reference: https://english.stackexchange.com/questions/20356/origin-of-i-can-haz
}
void loop() {
DateTime now = rtc.now();
//Serial.print(now.year(), DEC);
// Serial.print('/');
// Serial.print(now.month(), DEC);
// Serial.print('/');
// Serial.print(now.day(), DEC);
// Serial.print(' ');
// Serial.print(now.hour(), DEC);
// Serial.print(':');
// Serial.print(now.minute(), DEC);
// Serial.print(':');
// Serial.print(now.second(), DEC);
// Serial.println();
//uint16_t a = sec;
// uint32_t b = millis;
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(26, 20);
tft.setTextColor(ILI9341_BLUE);
tft.setTextSize(5);
tft.print(now.hour());
tft.print(":");
tft.println(now.minute());
tft.setCursor(120, 160);
tft.setTextColor(ILI9341_YELLOW);
tft.print(now.minute());
tft.print(":");
tft.println(now.second());
delay(1000);
}