#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ILI9341.h> // TFTLCD library
#include <math.h>
#define TFT_CLK 13 // Clock pin (shared with TFTCS)
#define TFT_RST 8 // Reset pin
#define TFT_DC 9 // Data/Command pin
#define TFT_CS 10 // Chip Select pin (shared with TFTCLK)
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
tft.begin();
//tft.setRotation(3); // Adjust the rotation if needed
tft.fillScreen(ILI9341_WHITE);
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(2);
int screenWidth = tft.width(); // Get the screen width
int screenHeight = tft.height();
//Serial.begin(9600);
//Serial.print("Screen Width: ");
//Serial.println(screenWidth);
//Serial.print("Screen Height: ");
//Serial.println(screenHeight);
}
void loop() {
// Your code to draw graphics and display content goes here
tft.fillRect(117, 6, 6, 320, ILI9341_BLACK);
tft.fillRect(0, 6, 240, 6, ILI9341_BLACK);
for(int i=0; i<=320; i++){
int temp = 100*sin(i*PI/180);
tft.fillRect(temp+117, i+6, 6, 6, ILI9341_RED);
delay(4);
}
//delay(2000); // Wait for 2 seconds
}