--> Project V - 28. Analog Clock on TFT LCD 2'4 Inch (Arduino Based) | basic arduino tutorial

Thursday, August 10, 2017

Project V - 28. Analog Clock on TFT LCD 2'4 Inch (Arduino Based)

| Thursday, August 10, 2017
Analog Clock on TFT LCD 2'4 Inch




Create an analog clock display with a 2'4 "TFT LCD touch screen with Arduino UNO as its processor.

Hardware Requirement
  • Arduino Uno
  • LCD TFT 2.4" Module with Touch Screen
  • Power supply +5 Volt
  • Jumper


LCD TFT 2’4” Shield Module  | Source


Schematic





Arduino - LCD 2.4" TFT Wiring


LCD 2.4" TFT Module is compatible with Arduino Uno, so you just plug in to the top of Arduino with All of pin connected, Like image below.




Source Code/Sketch
#include <Adafruit_GFX.h>
#include <Adafruit_TFTLCD.h>
#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
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
void setup(void) {
tft.reset();
uint16_t identifier = tft.readID();
if(identifier==0x0101)identifier=0x9341;
tft.begin(identifier);
}
void loop(void) {
tft.fillScreen(BLACK);
delay(2000);
tft.fillScreen(RED);
delay(2000);
tft.fillScreen(GREEN);
delay(2000);
tft.fillScreen(BLUE);
delay(2000);
tft.fillScreen(YELLOW);
delay(2000);
tft.fillScreen(MAGENTA);
delay(2000);
tft.fillScreen(CYAN);
delay(2000);
tft.fillScreen(WHITE);
delay(2000);
}



How it Works

1. Connect the Arduino with Peripherals needed
2. Plug in the Power Source on the device
3. Compile and upload the script program above to your arduino

4. The TFT LCD Shield module will display an analog clock, with 2 clock handles. With extra 
    number display for Hours, Minutes and Seconds.


Video for  Project V - 28. Jam Analog Pada TFT LCD 2'4 Inch berbasis Arduino Uno






Required File


Related Posts

4 comments:

  1. THANKS THIS IS THE ONLY SITE HAVING CORRECT CODE, SHEARED ON FB

    ReplyDelete
  2. How to add ds1307. and which line off the code is fetching computer time

    ReplyDelete
  3. 2 week searching for this project , i try evry solution i find in the web , no one work as i want so i decide to give up and put my stuff in drawer , and accidentally i find this , i say to my self why don't make a last try , if it work u get what u are looking for since 2 week , if not u ve the right to do what u want ... i upload the code and it works at the first shot ...it 's a magic i can't believe it , all my thanks for bro for sharing ur awesome project... it work yes it work

    ReplyDelete
  4. I copied the code and uploading in uno board but the display is white, no clock is seen in display. help me please

    ReplyDelete