/*
ESP32 HTTPClient Jokes API Example
https://wokwi.com/projects/342032431249883731
Copyright (C) 2022, Uri Shaked
*/
//MADHAVI(40905105)
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include "point.h"
#define SIZE 50
#define TFT_DC 2
#define TFT_CS 15
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup() {
tft.begin();
tft.setRotation(1);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
}
Point P1;
Point P2;
Point P3;
Point P4;
Point P9;
Point P10;
Point P11;
void draw_points(Point& P1, Point& P2)
{
tft.drawLine(
P1.get_x(),P1.get_y(),
P2.get_x(),P2.get_y(),
ILI9341_WHITE
);
}
void loop() {
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0,0);
//tft.print("Welcome to Drawing on TFT");
//tft.drawLine(150,150,0,50,ILI9341_WHITE );
P1.set_x(40);
P1.set_y(40);
P2.set_x(100);
P2.set_y(40);
P3.set_x(100);
P3.set_y(100);
P4.set_x(40);
P4.set_y(100);
P9.set_x(200);
P9.set_y(200);
P10.set_x(200);
P10.set_y(100);
P11.set_x(125);
P11.set_y(125);
draw_points(P1,P2);
draw_points(P2,P3);
draw_points(P3,P4);
draw_points(P4,P1);
draw_points(P9,P11);
draw_points(P11,P10);
draw_points(P10,P9);
delay(1000);
}