/*
ESP32 HTTPClient Jokes API Example
https://wokwi.com/projects/342032431249883731
Copyright (C) 2022, Uri Shaked
*/
#include "point.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#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;
void draw_points(Point& P1,Point& P2)
{
tft.drawLine(P1.get_x(),P1.get_x(),P2.get_x(),P2.get_x(),ILI9341_WHITE );
}
void loop() {
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0,0);
//tft.print("Welcome to Drawing on TFT");
P1.set_x(0);
P1.set_y(0);
P2.set_x(100);
P2.set_y(0);
P3.set_x(150);
P3.set_y(0);
P4.set_x(0);
P4.set_y(100);
draw_points(P1,P2);
delay(1000);
draw_points(P2,P3);
delay(1000);
draw_points(P3,P4);
delay(1000);
draw_points(P4,P1);
delay(1000);
}