/*
Just testing the ILI9341 Display with ESP32
*/
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#define BTN_PIN 5
#define TFT_DC 2
#define TFT_CS 15
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void nextLine() {
tft.setTextColor(ILI9341_WHITE);
tft.println("\nLoading joke...");
tft.setTextColor(ILI9341_GREEN);
tft.println("Dummy Joke");
}
void setup() {
pinMode(BTN_PIN, INPUT_PULLUP);
tft.begin();
tft.setRotation(0);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.print("in setup");
}
void loop() {
if (digitalRead(BTN_PIN) == LOW) {
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0, 0);
nextLine();
}
delay(100);
nextLine();
}