#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#define BLACK 0x0000 // Use black for chart background.
#define BLUE 0x001F // Define up to 7 "standard" colors for pie slices.
#define RED 0xF800 // More than 7 slices stretches use of this small display!
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
// Define the pins for your display
#define TFT_CS 15
#define TFT_DC 2
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_RST -1 // Use -1 if no reset pin is connected
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
int leftSide = 0;
int rightSide = 320;
uint16_t lineColor = ILI9341_RED; // Color of the circle
void setup() {
Serial.begin(115200);
// Initialize the screen
tft.begin();
tft.setRotation(2); // Rotate screen for landscape mode
// tft.fillScreen(BLUE);
}
float x = 50;
float y = 50;
int size = 10;
void loop() {
x = x + 1;
y = y + 1;
if(x > 240 + size){
x = 0;
}
if(y > 320 + size){
y = 0;
}
tft.fillCircle(x,y,size,BLUE);
tft.drawCircle(x,y,size+1,BLACK);
}