/*
Simple "Hello World" for ILI9341 LCD
https://wokwi.com/arduino/projects/308024602434470466
*/
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tae = Adafruit_ILI9341(TFT_CS, TFT_DC);
#define sw_green 7
void setup() {
pinMode(sw_green, INPUT_PULLUP);
tae.begin();
tae.setCursor(26, 120);
tae.setTextColor(ILI9341_PURPLE);
tae.setTextSize(3);
tae.println("Piriya ");
tae.setCursor(20, 160);
tae.setTextColor(ILI9341_GREEN);
tae.setTextSize(2);
tae.println("65201280041");
delay(3000);
tae.setCursor(26, 120);
tae.setTextColor(ILI9341_BLACK);
tae.setTextSize(3);
tae.println("Btn CC");
tae.setCursor(20, 160);
tae.setTextColor(ILI9341_BLACK);
tae.setTextSize(2);
tae.println("621232060106");
}
void loop() {
if(!digitalRead(sw_green)){
tae.setCursor(26, 120);
tae.setTextColor(ILI9341_GREEN);
tae.setTextSize(3);
tae.println("Green");
}else{
tae.setCursor(26, 120);
tae.setTextColor(ILI9341_BLACK);
tae.setTextSize(3);
tae.println("Green");
}
}