#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
int TFC_DC = 9;
int TFT_CS = 10;
const int led = 13;
const int but = 4;
//apparently it inits the display
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
Adafruit_ILI9341 tft = Adafruit_ILI9341(10, 9);
void setup() {
tft.begin();
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(but, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
int butState = digitalRead(but);
if (butState == LOW) {
digitalWrite(led, HIGH);
tft.fillScreen(ILI9341_BLUE);
} else {
digitalWrite(led, LOW);
tft.fillScreen(ILI9341_BLACK);
}
}