//Code By A.Tedds. //Using Adafruit Library Files. Thank you. //Usage of tft.drawRect(start position width 0-240,Start position Height 0-320,size 0-240,size 0-320, Color) #include // Core graphics library #include // Hardware-specific library #define LCD_CS A3 // Chip Select goes to Analog 3 #define LCD_CD A2 // Command/Data goes to Analog 2 #define LCD_WR A1 // LCD Write goes to Analog 1 #define LCD_RD A0 // LCD Read goes to Analog 0 #define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin // Assign human-readable names to some common 16-bit color values: // With Changes for inversion !! #define BLACK 0xFFFF #define BLUE 0xFFE0 #define GREEN 0xF81F #define CYAN 0xF800 #define GRAY1 0x8410 #define RED 0x07FF //define BRIGHT_RED 0x???? #define GRAY2 0x4208 #define MAGENTA 0x07E0 #define YELLOW 0x001F #define WHITE 0x0000 //boolean invert=true; Adafruit_ILI9341_8bit_AS tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); void setup(void) { tft.reset(); delay(10); tft.begin(0x9341); tft.fillScreen(BLACK); // Clear Screen to BLACK. //invertDisplay(boolean i); //from Lib //tft.invertDisplay (invert); //invert; // does not work tft.setTextSize(4); tft.setTextColor(WHITE); //set time //int hr = 2; //int mint = 39; //int sec = 0; } void loop() { for (int hr=0; hr<24;hr++) { for (int mint=0; mint<60;mint++) { for (int sec=0; sec<60;sec++) { tft.setCursor(25, 120); tft.print(hr); tft.print(":"); tft.print(mint); tft.print(":"); tft.print(sec); delay(700); tft.fillScreen(BLACK); } } } }