#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <Fonts/FreeSansBold12pt7b.h>
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#define BLACK 0x0000
#define LTGREY 0xc618
#define MIDGREY 0x8410
#define DKGREY 0x4208
#define WHITE 0xFFFF
void setup() {
tft.begin();
tft.setRotation(3);
tft.fillScreen(BLACK);
tft.fillRect(0, 0, 320, 240, MIDGREY);
// draw grid lines
for (int i = 38.5; i < 279; i = i + 30)
{
tft.fillRect(i, 0, 3, 240, WHITE);
}
for (int i = 13.5; i < 224; i = i + 30)
{
tft.fillRect(0, i, 320, 3, WHITE);
}
// draw diagonals
tft.fillTriangle(5, -14, 85, 46, 68, 72, WHITE); // TL
tft.fillTriangle(5, -14, 68, 72, -12, 12, WHITE);
tft.fillTriangle(-5, 10, 68, 65, 67, 67, BLACK);
tft.fillTriangle(-5, 10, 67, 67, -6, 12, BLACK);
tft.fillTriangle(-3, 7, 70, 62, 69, 64, BLACK);
tft.fillTriangle(-3, 7, 69, 64, -4, 9, BLACK);
tft.fillTriangle(-1, 4, 72, 59, 71, 61, BLACK);
tft.fillTriangle(-1, 4, 71, 61, -2, 6, BLACK);
tft.fillTriangle(1, 1, 74, 56, 73, 58, BLACK);
tft.fillTriangle(1, 1, 73, 58, 0, 3, BLACK);
tft.fillTriangle(3, -2, 76, 53, 75, 55, BLACK);
tft.fillTriangle(3, -2, 75, 55, 2, 0, BLACK);
tft.fillTriangle(5, -5, 78, 50, 77, 52, BLACK);
tft.fillTriangle(5, -5, 77, 52, 4, -3, BLACK);
tft.fillTriangle(7, -8, 80, 47, 79, 49, BLACK);
tft.fillTriangle(7, -8, 79, 49, 6, -6, BLACK);
tft.fillTriangle(315, -14, 235, 46, 252, 72, WHITE); //TR
tft.fillTriangle(315, -14, 252, 72, 332, 12, WHITE);
tft.fillTriangle(325, 10, 252, 65, 253, 67, BLACK);
tft.fillTriangle(325, 10, 253, 67, 326, 12, BLACK);
tft.fillTriangle(323, 7, 250, 62, 251, 64, BLACK);
tft.fillTriangle(323, 7, 251, 64, 324, 9, BLACK);
tft.fillTriangle(321, 4, 248, 59, 249, 61, BLACK);
tft.fillTriangle(321, 4, 249, 61, 322, 6, BLACK);
tft.fillTriangle(319, 1, 246, 56, 247, 58, BLACK);
tft.fillTriangle(319, 1, 247, 58, 320, 3, BLACK);
tft.fillTriangle(317, -2, 244, 53, 245, 55, BLACK);
tft.fillTriangle(317, -2, 245, 55, 318, 0, BLACK);
tft.fillTriangle(315, -5, 242, 50, 243, 52, BLACK);
tft.fillTriangle(315, -5, 243, 52, 316, -3, BLACK);
tft.fillTriangle(313, -8, 240, 47, 241, 49, BLACK);
tft.fillTriangle(313, -8, 241, 49, 314, -6, BLACK);
tft.fillTriangle(315, 254, 235, 194, 252, 168, WHITE); //BR
tft.fillTriangle(315, 254, 252, 168, 332, 228, WHITE);
tft.fillTriangle(325, 230, 252, 175, 253, 173, BLACK);
tft.fillTriangle(325, 230, 253, 173, 326, 228, BLACK);
tft.fillTriangle(323, 233, 250, 178, 251, 176, BLACK);
tft.fillTriangle(323, 233, 251, 176, 324, 231, BLACK);
tft.fillTriangle(321, 236, 248, 181, 249, 179, BLACK);
tft.fillTriangle(321, 236, 249, 179, 322, 234, BLACK);
tft.fillTriangle(319, 239, 246, 184, 247, 182, BLACK);
tft.fillTriangle(319, 239, 247, 182, 320, 237, BLACK);
tft.fillTriangle(317, 242, 244, 187, 245, 185, BLACK);
tft.fillTriangle(317, 242, 245, 185, 318, 240, BLACK);
tft.fillTriangle(315, 245, 242, 190, 243, 188, BLACK);
tft.fillTriangle(315, 245, 243, 188, 316, 243, BLACK);
tft.fillTriangle(313, 248, 240, 193, 241, 191, BLACK);
tft.fillTriangle(313, 248, 241, 191, 314, 246, BLACK);
tft.fillTriangle(5, 254, 85, 194, 68, 168, WHITE); //BL
tft.fillTriangle(5, 254, 68, 168, -12, 228, WHITE);
tft.fillTriangle(-5, 230, 68, 175, 67, 173, BLACK);
tft.fillTriangle(-5, 230, 67, 173, -6, 228, BLACK);
tft.fillTriangle(-3, 233, 70, 178, 69, 176, BLACK);
tft.fillTriangle(-3, 233, 69, 176, -4, 231, BLACK);
tft.fillTriangle(-1, 236, 72, 181, 71, 179, BLACK);
tft.fillTriangle(-1, 236, 71, 179, -2, 234, BLACK);
tft.fillTriangle(1, 239, 74, 184, 73, 182, BLACK);
tft.fillTriangle(1, 239, 73, 182, 0, 237, BLACK);
tft.fillTriangle(3, 242, 76, 187, 75, 185, BLACK);
tft.fillTriangle(3, 242, 75, 185, 2, 240, BLACK);
tft.fillTriangle(5, 245, 78, 190, 77, 188, BLACK);
tft.fillTriangle(5, 245, 77, 188, 4, 243, BLACK);
tft.fillTriangle(7, 248, 80, 193, 79, 191, BLACK);
tft.fillTriangle(7, 248, 79, 191, 6, 246, BLACK);
// draw border white
tft.fillRect(0, 0, 320, 9, WHITE); //top
tft.fillRect(0, 0, 9, 240, WHITE); //left
tft.fillRect(0, 231, 320, 9, WHITE); //bot
tft.fillRect(311, 0, 9, 240, WHITE); //right
// draw border black
tft.fillRect(0, 0, 17.5, 9, BLACK);
tft.fillRect(0, 0, 9, 22.5, BLACK);
tft.fillRect(302.5, 0, 22.5, 9, BLACK);
tft.fillRect(311, 0, 9, 22.5, BLACK);
tft.fillRect(0, 217.5, 9, 22.5, BLACK);
tft.fillRect(0, 231, 17.5, 9, BLACK);
tft.fillRect(311, 217.5, 9, 22.5, BLACK);
tft.fillRect(302.5, 231, 22.5, 9, BLACK);
for (int i = 32.5; i < 273; i = i + 30)
{
tft.fillRect(i, 0, 15, 9, BLACK);
}
for (int i = 32.5; i < 273; i = i + 30)
{
tft.fillRect(i, 231, 15, 9, BLACK);
}
for (int i = 37.5; i < 188; i = i + 30)
{
tft.fillRect(0, i, 9, 15, BLACK);
}
for (int i = 37.5; i < 188; i = i + 30)
{
tft.fillRect(311, i, 9, 15, BLACK);
}
// draw border arrows
tft.fillTriangle(159, 0, 167, 9, 152, 9, WHITE); // top
tft.fillTriangle(152, 231, 167, 231, 159, 240, WHITE); // bot
tft.fillTriangle(0, 119, 9, 112, 9, 127, BLACK); // left
tft.fillTriangle(311, 112, 320, 119, 311, 127, BLACK); // right
// C bg
tft.fillRect(131.5, 196, 57, 28, MIDGREY);
// Letterbox
tft.fillRect(119, 20, 82, 28, WHITE);
tft.fillRect(134, 30, 52, 8, BLACK);
//Wings
tft.fillRect(68, 73.5, 41, 93, BLACK);
tft.fillRect(210, 73.5, 41, 93, WHITE);
tft.fillRect(75, 92.5, 2, 55, WHITE);
tft.fillRect(243, 92.5, 2, 55, BLACK);
//centre circles
tft.fillCircle(160, 120, 69, WHITE);
tft.fillCircle(160, 120, 67, BLACK);
tft.fillCircle(160, 120, 63.5, WHITE);
tft.fillCircle(160, 120, 60, MIDGREY);
//greyscale boxes
tft.fillRect(152, 80, 16, 16, WHITE);
tft.fillRect(152, 96, 16, 16, LTGREY);
tft.fillRect(152, 112, 16, 16, MIDGREY);
tft.fillRect(152, 128, 16, 16, DKGREY);
tft.fillRect(152, 144, 16, 16, BLACK);
//grad boxes
tft.fillRect(122, 73.5, 18, 93, WHITE);
tft.fillRect(180, 73.5, 18, 93, WHITE);
//grads left
tft.drawFastVLine(123, 80, 15, MIDGREY);
tft.drawFastVLine(124, 80, 15, BLACK);
tft.drawFastVLine(125, 80, 15, DKGREY);
tft.drawFastVLine(127, 80, 15, LTGREY);
tft.drawFastVLine(128, 80, 15, BLACK);
tft.drawFastVLine(129, 80, 15, BLACK);
tft.drawFastVLine(132, 80, 15, BLACK);
tft.drawFastVLine(133, 80, 15, BLACK);
tft.drawFastVLine(134, 80, 15, LTGREY);
tft.drawFastVLine(136, 80, 15, MIDGREY);
tft.drawFastVLine(137, 80, 15, BLACK);
tft.drawFastVLine(138, 80, 15, MIDGREY);
tft.drawFastVLine(123, 96, 15, MIDGREY);
tft.drawFastVLine(124, 96, 15, BLACK);
tft.drawFastVLine(126, 96, 15, DKGREY);
tft.drawFastVLine(127, 96, 15, MIDGREY);
tft.drawFastVLine(129, 96, 15, BLACK);
tft.drawFastVLine(130, 96, 15, LTGREY);
tft.drawFastVLine(131, 96, 15, LTGREY);
tft.drawFastVLine(132, 96, 15, BLACK);
tft.drawFastVLine(134, 96, 15, DKGREY);
tft.drawFastVLine(135, 96, 15, BLACK);
tft.drawFastVLine(137, 96, 15, BLACK);
tft.drawFastVLine(138, 96, 15, MIDGREY);
tft.drawFastVLine(123, 112, 16, MIDGREY);
tft.drawFastVLine(124, 112, 16, DKGREY);
tft.drawFastVLine(125, 112, 16, MIDGREY);
tft.drawFastVLine(126, 112, 16, DKGREY);
tft.drawFastVLine(127, 112, 16, MIDGREY);
tft.drawFastVLine(128, 112, 16, DKGREY);
tft.drawFastVLine(129, 112, 16, MIDGREY);
tft.drawFastVLine(130, 112, 16, DKGREY);
tft.drawFastVLine(131, 112, 16, MIDGREY);
tft.drawFastVLine(132, 112, 16, DKGREY);
tft.drawFastVLine(133, 112, 16, MIDGREY);
tft.drawFastVLine(134, 112, 16, DKGREY);
tft.drawFastVLine(135, 112, 16, MIDGREY);
tft.drawFastVLine(136, 112, 16, DKGREY);
tft.drawFastVLine(137, 112, 16, MIDGREY);
tft.drawFastVLine(138, 112, 16, DKGREY);
tft.drawFastVLine(123, 129, 15, MIDGREY);
tft.drawFastVLine(124, 129, 15, LTGREY);
tft.drawFastVLine(125, 129, 15, BLACK);
tft.drawFastVLine(126, 129, 15, LTGREY);
tft.drawFastVLine(127, 129, 15, MIDGREY);
tft.drawFastVLine(128, 129, 15, BLACK);
tft.drawFastVLine(129, 129, 15, LTGREY);
tft.drawFastVLine(130, 129, 15, DKGREY);
tft.drawFastVLine(131, 129, 15, DKGREY);
tft.drawFastVLine(132, 129, 15, LTGREY);
tft.drawFastVLine(133, 129, 15, BLACK);
tft.drawFastVLine(134, 129, 15, MIDGREY);
tft.drawFastVLine(135, 129, 15, LTGREY);
tft.drawFastVLine(136, 129, 15, BLACK);
tft.drawFastVLine(137, 129, 15, LTGREY);
tft.drawFastVLine(138, 129, 15, MIDGREY);
tft.drawFastVLine(123, 145, 15, MIDGREY);
tft.drawFastVLine(124, 145, 15, LTGREY);
tft.drawFastVLine(125, 145, 15, LTGREY);
tft.drawFastVLine(126, 145, 15, DKGREY);
tft.drawFastVLine(127, 145, 15, MIDGREY);
tft.drawFastVLine(128, 145, 15, LTGREY);
tft.drawFastVLine(129, 145, 15, LTGREY);
tft.drawFastVLine(130, 145, 15, MIDGREY);
tft.drawFastVLine(131, 145, 15, MIDGREY);
tft.drawFastVLine(132, 145, 15, LTGREY);
tft.drawFastVLine(133, 145, 15, LTGREY);
tft.drawFastVLine(134, 145, 15, MIDGREY);
tft.drawFastVLine(135, 145, 15, DKGREY);
tft.drawFastVLine(136, 145, 15, LTGREY);
tft.drawFastVLine(137, 145, 15, LTGREY);
tft.drawFastVLine(138, 145, 15, MIDGREY);
//grads right
tft.drawFastVLine(181, 145, 15, MIDGREY);
tft.drawFastVLine(182, 145, 15, BLACK);
tft.drawFastVLine(183, 145, 15, DKGREY);
tft.drawFastVLine(185, 145, 15, LTGREY);
tft.drawFastVLine(186, 145, 15, BLACK);
tft.drawFastVLine(187, 145, 15, BLACK);
tft.drawFastVLine(190, 145, 15, BLACK);
tft.drawFastVLine(191, 145, 15, BLACK);
tft.drawFastVLine(192, 145, 15, LTGREY);
tft.drawFastVLine(194, 145, 15, MIDGREY);
tft.drawFastVLine(195, 145, 15, BLACK);
tft.drawFastVLine(196, 145, 15, MIDGREY);
tft.drawFastVLine(181, 129, 15, MIDGREY);
tft.drawFastVLine(182, 129, 15, BLACK);
tft.drawFastVLine(184, 129, 15, DKGREY);
tft.drawFastVLine(185, 129, 15, MIDGREY);
tft.drawFastVLine(187, 129, 15, BLACK);
tft.drawFastVLine(188, 129, 15, LTGREY);
tft.drawFastVLine(189, 129, 15, LTGREY);
tft.drawFastVLine(190, 129, 15, BLACK);
tft.drawFastVLine(192, 129, 15, DKGREY);
tft.drawFastVLine(193, 129, 15, BLACK);
tft.drawFastVLine(195, 129, 15, BLACK);
tft.drawFastVLine(196, 129, 15, MIDGREY);
tft.drawFastVLine(181, 112, 16, MIDGREY);
tft.drawFastVLine(182, 112, 16, DKGREY);
tft.drawFastVLine(183, 112, 16, MIDGREY);
tft.drawFastVLine(184, 112, 16, DKGREY);
tft.drawFastVLine(185, 112, 16, MIDGREY);
tft.drawFastVLine(186, 112, 16, DKGREY);
tft.drawFastVLine(187, 112, 16, MIDGREY);
tft.drawFastVLine(188, 112, 16, DKGREY);
tft.drawFastVLine(189, 112, 16, MIDGREY);
tft.drawFastVLine(190, 112, 16, DKGREY);
tft.drawFastVLine(191, 112, 16, MIDGREY);
tft.drawFastVLine(192, 112, 16, DKGREY);
tft.drawFastVLine(193, 112, 16, MIDGREY);
tft.drawFastVLine(194, 112, 16, DKGREY);
tft.drawFastVLine(195, 112, 16, MIDGREY);
tft.drawFastVLine(196, 112, 16, DKGREY);
tft.drawFastVLine(181, 96, 15, MIDGREY);
tft.drawFastVLine(182, 96, 15, LTGREY);
tft.drawFastVLine(183, 96, 15, BLACK);
tft.drawFastVLine(184, 96, 15, LTGREY);
tft.drawFastVLine(185, 96, 15, MIDGREY);
tft.drawFastVLine(186, 96, 15, BLACK);
tft.drawFastVLine(187, 96, 15, LTGREY);
tft.drawFastVLine(188, 96, 15, DKGREY);
tft.drawFastVLine(189, 96, 15, DKGREY);
tft.drawFastVLine(190, 96, 15, LTGREY);
tft.drawFastVLine(191, 96, 15, BLACK);
tft.drawFastVLine(192, 96, 15, MIDGREY);
tft.drawFastVLine(193, 96, 15, LTGREY);
tft.drawFastVLine(194, 96, 15, BLACK);
tft.drawFastVLine(195, 96, 15, LTGREY);
tft.drawFastVLine(196, 96, 15, MIDGREY);
tft.drawFastVLine(181, 80, 15, MIDGREY);
tft.drawFastVLine(182, 80, 15, LTGREY);
tft.drawFastVLine(183, 80, 15, LTGREY);
tft.drawFastVLine(184, 80, 15, DKGREY);
tft.drawFastVLine(185, 80, 15, MIDGREY);
tft.drawFastVLine(186, 80, 15, LTGREY);
tft.drawFastVLine(187, 80, 15, LTGREY);
tft.drawFastVLine(188, 80, 15, MIDGREY);
tft.drawFastVLine(189, 80, 15, MIDGREY);
tft.drawFastVLine(190, 80, 15, LTGREY);
tft.drawFastVLine(191, 80, 15, LTGREY);
tft.drawFastVLine(192, 80, 15, MIDGREY);
tft.drawFastVLine(193, 80, 15, DKGREY);
tft.drawFastVLine(194, 80, 15, LTGREY);
tft.drawFastVLine(195, 80, 15, LTGREY);
tft.drawFastVLine(196, 80, 15, MIDGREY);
tft.setFont(&FreeSansBold12pt7b);
tft.setCursor(150, 218);
tft.setTextColor(WHITE);
tft.print("C");
delay(2000);
tft.fillRect(131.5, 196, 57, 28, MIDGREY);
tft.setCursor(150, 218);
tft.setTextColor(WHITE);
tft.print("Z");
}
void loop(void) {}