#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);
void setup() {
// put your setup code here, to run once:
tft.begin();
tft.setRotation(1);
printHeader();
}
void loop() {
// put your main code here, to run repeatedly:
}
//Print headers
unsigned long printHeader(void )
{
tft.fillRect(0,0,180, 64,ILI9341_GREEN);
tft.fillRect(0,32,180, 64,ILI9341_RED);
tft.fillRect(0,64,180, 64,ILI9341_CYAN);
tft.fillRect(0,96,180, 64,ILI9341_YELLOW);
tft.fillRect(0,128,180, 64,ILI9341_ORANGE);
tft.fillRect(0,160,180, 64,ILI9341_RED);
tft.fillRect(0,190,180, 64,ILI9341_WHITE);
tft.fillRect(180,0,240, 64,ILI9341_CYAN);
tft.fillRect(180,32,240, 64,ILI9341_YELLOW);
tft.fillRect(180,64,240, 64,ILI9341_ORANGE);
tft.fillRect(180,96,240, 64,ILI9341_GREEN);
tft.fillRect(180,128,240, 64,ILI9341_CYAN);
tft.fillRect(180,160,240, 64,ILI9341_PURPLE);
tft.fillRect(180,190,240, 64,ILI9341_WHITE);
unsigned long start = micros();
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(2);
//
tft.setCursor(50,0+10);
tft.print("CELCIUS");
//
tft.setCursor(50,32+10);
tft.print("FAHRENHEIT");
//
tft.setCursor(50,64+10);
tft.print("KELVIN");
//
tft.setCursor(50,96+10);
tft.print("RANKIN");
//
tft.setCursor(50,128+10);
tft.print("HUMIDITY");
return micros() - start;
}