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

#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

#define PinButton 2
#define Led0 3

int statoLed0 = 0;



void setup() {

  pinMode(PinButton, INPUT);
  pinMode(Led0, OUTPUT);

  tft.begin();

  tft.setCursor(26, 120);
  tft.setTextColor(ILI9341_RED);
  tft.setTextSize(3);
  tft.println("MaxxiMax");

  tft.setCursor(20, 160);
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(2);
  tft.println("I can has colors?");
  delay(1000);
  yield();
  tft.fillScreen(ILI9341_RED);
  yield();
  tft.fillScreen(ILI9341_GREEN);
  delay(500);
  tft.setTextColor(ILI9341_RED);    tft.setTextSize(4);
  tft.println(0xDEADBEEF, HEX);
  delay(1000);
  yield();
  tft.fillScreen(ILI9341_BLUE);
}

void loop() {

  if ( digitalRead(PinButton) == HIGH );
  {
    if ( statoLed0 == LOW  ) statoLed0 = HIGH;
    else                     statoLed0 = LOW;
    digitalWrite( Led0, statoLed0 );
    delay(200);

  }
  }