i want to display current date and time in TFT screen.
how can i get them as variables ?
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#include "TFTLCD.h"
#include <Keypad.h>
#include <Button.h>
const byte ROWS = 5;
const byte COLS = 4;
char buff[50];
long lastUpdate = 0;
int x,i,e,k,e1,e2,e3,e4,e5,x1,x2,f,e6;
int w = 100;
int h=150;
byte b;
char inbytes[10];
int bytesRead;
char buffer[24];
int j;
int total_read = 0;
char key;
Button button = Button(8,PULLUP);
TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
char keys[ROWS][COLS] =
{
{'1','6','E','N'},
{'2','7','B','M'},
{'3','8','I','X'},
{'4','9','T','Y'},
{'5','0','D','Z'},
};
byte rowPins[ROWS] = {40,39,38,37,36}; //connect to row pinouts
byte colPins[COLS] = {32,33,34,35}; //connect to column pinouts
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(void)
{
Serial.begin(115200);
Serial.println(" User Interface Menu Started! ");
tft.reset();
tft.initDisplay();
}
void(* resetFunc) (void) = 0;
void loop(void)
{
if(button.isPressed())
{
testtext8(BLACK) ;
testfillcircles(17, RED);
delay(1500);
testfastlines(BLUE,BLUE);
delay(1500);
resetFunc(); /////// BUTTON PRESS RESET
}
.....................................................................................