#include <Adafruit_ILI9341.h>
#include <Adafruit_GFX.h>
#include "shapes.h"
#define TFT_CLK 13
#define TFT_RST 9
#define TFT_DC 8
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void drawShape(IShape* shape, int x, int y, uint16_t color) {
shape->draw(tft, x, y, color);
}
void setup() {
tft.begin();
tft.setRotation(3); // Adjust the rotation as needed
tft.fillScreen(ILI9341_BLACK);
}
void loop() {
Circle circle(50);
Rectangle rectangle(80, 60);
Triangle triangle(100, 70);
int x = 120;
int y = 160;
uint16_t colors[] = {ILI9341_RED, ILI9341_GREEN, ILI9341_BLUE};
for (int i = 0; i < 3; i++) {
drawShape(&circle, x, y, colors[i]);
delay(1000);
}
}