/*
  ESP32 + ILI9341 LCD Basic Example

  https://wokwi.com/projects/325324981270479442
*/

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

#define TFT_DC 2
#define TFT_CS 15
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

void setup() {
  tft.begin();
  tft.fillTriangle(60, 60, 100, 20, 140, 60, ILI9341_BLUE); // Dibujar un triángulo azul
  tft.fillCircle(120, 120, 30, ILI9341_YELLOW); // Dibujar un círculo amarillo

  tft.setCursor(0, 120);
  tft.setTextColor(ILI9341_RED);
  tft.setTextSize(3);
  tft.println("ADVERTENCIA");

  tft.setCursor(24, 160);
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(2);
  tft.println("COLICION INMINENTE.");
}

void loop() { 
  delay(10000);
  tft.fillScreen(ILI9341_BLACK); // Cambiar todo a rojo
  delay(1000); // Esperar 1 segundo

  tft.fillScreen(ILI9341_GREEN); // Cambiar todo a verde
  delay(1000); // Esperar 1 segundo
  
  delay(10); 
}