#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

// Define TFT display pins
#define TFT_CS     10
#define TFT_RST    9
#define TFT_DC     8
#define TFT_MOSI   11
#define TFT_CLK    13
#define TFT_MISO   12

// Initialize ILI9341 TFT display
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  tft.begin();
  tft.fillScreen(ILI9341_BLACK);  // Set background to black
}

void loop() {
  drawRadiatingLED(120, 160);  // Center position of the display

  delay(100);  // Small delay to slow down the animation
}

void drawRadiatingLED(int x, int y) {
  // Draw red LED
  tft.fillRect(x - 10, y - 10, 20, 20, ILI9341_RED);  // 20x20 red LED

  // Draw quanta radiating from the LED
  for (int radius = 5; radius < 50; radius += 5) {
    tft.drawCircle(x, y, radius, ILI9341_WHITE);  // White quanta circle
    delay(50);  // Delay for visualization effect
    tft.drawCircle(x, y, radius, ILI9341_BLACK);  // Erase quanta circle
  }
}