#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_DC 9
#define TFT_CS 10
#define sw_green 7
#define sw_RED 6
#define sw_BLUE 5
#define sw_YELLOW 4
#define sw_WHITE 3
Adafruit_ILI9341 FEP = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup() {
pinMode(sw_green, INPUT_PULLUP);
pinMode(sw_RED, INPUT_PULLUP);
pinMode(sw_BLUE, INPUT_PULLUP);
pinMode(sw_YELLOW, INPUT_PULLUP);
pinMode(sw_WHITE, INPUT_PULLUP);
FEP.begin();
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_RED);
FEP.setTextSize(3);
FEP.println("Hi,fern<3");
FEP.setCursor(20, 160);
FEP.setTextColor(ILI9341_GREEN);
FEP.setTextSize(2);
FEP.println("65201280016");
delay(3000);
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_BLACK);
FEP.setTextSize(3);
FEP.println("Hi,fern<3");
FEP.setCursor(20, 160);
FEP.setTextColor(ILI9341_BLACK);
FEP.setTextSize(2);
FEP.println("65201280016");
}
void loop() {
if (!digitalRead(sw_green) == 1) {
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_GREEN);
FEP.setTextSize(3);
FEP.println("GREEN");
delay(2000);
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_BLACK);
FEP.setTextSize(3);
FEP.println("GREEN");
}
if (!digitalRead(sw_RED) == 1) {
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_RED);
FEP.setTextSize(3);
FEP.println("RED");
delay(2000);
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_BLACK);
FEP.setTextSize(3);
FEP.println("RED");
}
if (!digitalRead(sw_BLUE) == 1) {
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_BLUE);
FEP.setTextSize(3);
FEP.println("BLUE");
delay(2000);
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_BLACK);
FEP.setTextSize(3);
FEP.println("BLUE");
}
if (!digitalRead(sw_YELLOW) == 1 ){
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_YELLOW);
FEP.setTextSize(3);
FEP.println("YELLOW");
delay(2000);
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_BLACK);
FEP.setTextSize(3);
FEP.println("YELLOW");
}
if(!digitalRead(sw_WHITE) == 1){
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_WHITE);
FEP.setTextSize(3);
FEP.println("WHITE");
delay(2000);
FEP.setCursor(26, 120);
FEP.setTextColor(ILI9341_BLACK);
FEP.setTextSize(3);
FEP.println("WHITE");
}
}