#include <Adafruit_ILI9341.h>
#include <SPI.h>
#include <WiFi.h>
//#include <Time.h>
#include <SimpleTimer.h>
// Replace with your network credentials
const char* ssid = "FTTH-861B";
const char* password = "raj1234567";
// Replace with your time server address
const char* ntpServer = "pool.ntp.org";
// Set the time zone offset in seconds from UTC
const int timeZoneOffset = -18000;
// Initialize the ILI9341 display
#define TFT_CS 5
#define TFT_DC 4
#define TFT_MOSI 23
#define TFT_CLK 18
#define TFT_RST -1
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST);
// Initialize variables for the clock hands
int hourHandLength = 25;
int minuteHandLength = 35;
int secondHandLength = 40;
int centerX = 120;
int centerY = 120;
void setup() {
Serial.begin(115200);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
// Initialize the time library
configTime(timeZoneOffset, 0, ntpServer);
// Initialize the ILI9341 display
tft.begin();
tft.setRotation(3); // Rotate the display 90 degrees clockwise
// Clear the display and draw the clock face
tft.fillScreen(ILI9341_BLACK);
tft.drawCircle(centerX, centerY, 80, ILI9341_WHITE);
tft.fillCircle(centerX, centerY, 3, ILI9341_WHITE);
for (int i = 0; i < 60; i++) {
int angle = i * 6;
int outerX = centerX + 70 * cos(angle * PI / 180);
int outerY = centerY + 70 * sin(angle * PI / 180);
int innerX = centerX + 65 * cos(angle * PI / 180);
int innerY = centerY + 65 * sin(angle * PI / 180);
}
if (i % 5 == 0) {
tft.drawLine(outerX, outer);
}