/*
Simple "Hello World" for ILI9341 LCD
https://wokwi.com/arduino/projects/308024602434470466
*/
#include "Adafruit_ILI9341.h"
#include "TFT_eSPI.h"
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
//TFT_eSPI radarsp = TFT_eSprite(&tft);
uint8_t red = 0;
uint8_t blue =0;
uint8_t green = 0;
int angle=0;
void setup() {
tft.begin();
drawRadarTr(120,160,100,ILI9341_GREEN,0);
}
void loop() {
tft.setCursor(26, 120);
tft.setTextColor(ILI9341_RED);
tft.setTextSize(3);
tft.println("Hello, TFT!");
}
void drawRadarTr(int x, int y, int radius, int color, int startAngle)
{
int i=0;
while(green <= 250)
{
double radians = i * PI / 180;
double px = x + radius * cos(radians);
double py = y + radius * sin(radians);
double radians2 = (i+2) * PI / 180;
double px2 = x + radius * cos(radians2);
double py2 = y + radius * sin(radians2);
int color=tft.color565(red,green,blue);
tft.fillTriangle(x,y,px,py,px2,py2,color);
green=green+2;
i=i+1;
}
}