Arnov Sharma
Published © MIT

Getting Started with ILI9255 TFT LCD

A short tutorial on running an ILI9225 Display with your Arduino Board

BeginnerFull instructions provided18 minutes12,848
Getting Started with ILI9255 TFT LCD

Things used in this project

Hardware components

ILI9225
×1
Arduino Leonardo
Arduino Leonardo
×1
UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

sch

Code

Triangle Sketch

C/C++
#include "SPI.h"
#include "TFT_22_ILI9225.h"
#include "math.h"


#define TFT_RST A4
#define TFT_RS  A3
#define TFT_CS  A5  // SS
#define TFT_SDI A2  // MOSI
#define TFT_CLK A1  // SCK
#define TFT_LED 0   // 0 if wired to +5V directly

#define TFT_BRIGHTNESS 200 // Initial brightness of TFT backlight (optional)

#define ROTATE_ANGLE 10 // Angle in degrees to rotate the triangle

struct _point
{
    int16_t x;
    int16_t y;
};

// Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED);

// Variables and constants
_point c1, c2, c3, cc;

// Setup
void setup() {
  tft.begin();

  // Define triangle start coordinates
  c1.x = 30;  c1.y = 30;
  c2.x = 120; c2.y = 80;
  c3.x = 80;  c3.y = 130;

  // Determine the rotation point, i.e. the center of the triangle
  cc = getCoordCentroid(c1, c2, c3);
  
  tft.clear();
}

// Loop
void loop() {
  // Calculate the number of steps to rotate the triangle a full rotation
  int16_t steps = (int16_t)(360 / ROTATE_ANGLE);

  // Draw solid triangle
  tft.fillTriangle(30, 190, 80, 150, 130, 210, COLOR_BLUE);

  for (int8_t i = 0; i < steps; i++) {
    // Draw triangle
    tft.drawTriangle(c1.x, c1.y, c2.x, c2.y, c3.x, c3.y, COLOR_GREEN);
    // Rotate triangle
    rotateTriangle(c1, c2, c3, cc, ROTATE_ANGLE);
    delay(50);
  }
  delay(5000);
  tft.clear();
}

// Get centroid of triangle
_point getCoordCentroid( _point a, _point b, _point c ) {
  _point o;

  o.x = (int16_t)((a.x + b.x + c.x) / 3);
  o.y = (int16_t)((a.y + b.y + c.y) / 3);

  return o;
}

// Rotate triangle around point r
void rotateTriangle( _point &a, _point &b, _point &c, _point r, int16_t deg ) {

  // Convert degrees to radians
  float angle = (float)deg * 1000 / 57296;

  // Rotate each individual point
  a = rotatePoint( r, angle, a);
  b = rotatePoint( r, angle, b);
  c = rotatePoint( r, angle, c);
}

// Rotate each point p around c
_point rotatePoint( _point c, float angle, _point p ) {
  _point r;
  
  // 1. translate point back to origin
  // 2. rotate point
  // 3. translate point back

  r.x = cos(angle) * (p.x - c.x) - sin(angle) * (p.y - c.y) + c.x;
  r.y = sin(angle) * (p.x - c.x) + cos(angle) * (p.y - c.y) + c.y;

  return r;
}

DEMO

C/C++
#include "SPI.h"
#include "TFT_22_ILI9225.h"


#define TFT_RST A4
#define TFT_RS  A3
#define TFT_CS  A5  // SS
#define TFT_SDI A2  // MOSI
#define TFT_CLK A1  // SCK
#define TFT_LED 0   // 0 if wired to +5V directly

#define TFT_BRIGHTNESS 200 // Initial brightness of TFT backlight (optional)

// Use hardware SPI (faster - on Uno: 13-SCK, 12-MISO, 11-MOSI)
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED);


// Variables and constants
uint16_t x, y;
boolean flag = false;

/*
 * Tux black/white image in 180x220 converted using Ardafruit bitmap converter
 * https://github.com/ehubin/Adafruit-GFX-Library/tree/master/Img2Code
 */
static const uint8_t PROGMEM tux[] = 
{
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x0,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x0,0x0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x0,0x0,0x0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x0,0x0,0x0,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x0,0x0,0x0,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x0,0x0,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x1,0xfc,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x7,0xfe,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1,0xf8,0x0,0xf,0xff,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x3,0xfc,0x0,0x1f,0xff,0x80,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x7,0xfe,0x0,0x1f,0xff,0xc0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x7,0xfe,0x0,0x3f,0xff,0xc0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xff,0x0,0x3f,0xff,0xe0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xff,0x0,0x7f,0xf,0xe0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xbf,0x80,0x7e,0x7,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xf,0x80,0x7c,0x7,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x7,0x80,0x78,0x3,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x7,0x80,0x78,0x3,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x7,0x80,0x78,0x3,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x3,0x80,0x78,0x3,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x3,0x0,0x38,0x3,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x0,0x0,0x0,0x3,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x0,0xff,0xc0,0x3,0xe0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x6,0x1,0xff,0xf8,0x3,0xe0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7,0x7,0xff,0xfc,0x7,0xe0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3,0x8f,0xff,0xff,0x7,0xc0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3,0x1f,0xff,0xff,0xc0,0x80,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x3f,0xff,0xff,0xf8,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1,0xff,0xff,0xff,0xff,0xc0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3,0xff,0xff,0xff,0xff,0xe0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf,0xff,0xff,0xff,0xff,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xff,0xff,0xff,0xfe,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x19,0xff,0xff,0xff,0xf8,0x70,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x18,0xff,0xff,0xff,0xe0,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1c,0x7f,0xff,0xff,0x87,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xe,0x3f,0xff,0xff,0xf,0xe0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x7,0x1f,0xff,0xfc,0x3f,0xc0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x7,0x87,0xff,0xf0,0xff,0x80,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x3,0xe1,0xff,0xc3,0xff,0x10,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0xf0,0x38,0xf,0xfe,0x38,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x7e,0x0,0x3f,0xf8,0x78,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x2,0x1f,0xe7,0xff,0xc1,0xf8,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x3,0x8f,0xff,0xff,0x7,0xfc,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x3,0xc7,0xff,0xfe,0x3f,0xfc,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x3,0xe3,0xff,0xf8,0x7f,0xfc,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x7,0xf0,0xff,0xe1,0xff,0xfe,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x7,0xfc,0x3f,0x7,0xff,0xfe,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7,0xfe,0x0,0x1f,0xff,0xfe,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7,0xff,0xc0,0xff,0xff,0xff,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x7,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xf,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xf,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x0,0x7,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x7,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x3,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x1,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x2,0x0,0x0,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1,0x0,0x0,0x7f,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x80,0x0,0x3f,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x40,0x0,0x3f,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x20,0x0,0x1f,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x0,0x0,0xf,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x10,0x0,0xf,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xc0,0x10,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x8,0x0,0x7,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0x80,0x20,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0,0x0,0x7,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0x0,0x20,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x4,0x0,0x3,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0x0,0x40,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x2,0x0,0x1,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xfe,0x0,0x40,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x2,0x0,0x1,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xfe,0x0,0x80,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x1,0x0,0x0,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xfc,0x0,0x80,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x1,0x0,0x0,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xfc,0x1,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x1,0x80,0x0,0x7f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xf8,0x1,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x80,0x0,0x7f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xf8,0x2,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0xc0,0x0,0x7f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xf0,0x2,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0xc0,0x0,0x3f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xf0,0x6,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x40,0x0,0x3f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xe0,0x4,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x60,0x0,0x1f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xe0,0x4,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x60,0x0,0x1f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xc0,0xc,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x60,0x0,0x1f,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xc0,0xc,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x60,0x0,0xf,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xc0,0x8,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x30,0x0,0xf,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0x80,0x8,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x30,0x0,0xf,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0x80,0x18,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x30,0x0,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0x80,0x18,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x30,0x0,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0x0,0x18,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x30,0x0,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0x0,0x18,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x30,0x0,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0x0,0x18,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x70,0x0,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfe,0x0,0x18,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x70,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfe,0x0,0x18,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x70,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfe,0x0,0x18,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x70,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfe,0x0,0x18,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xf0,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x18,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x1c,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x1c,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x1c,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x3e,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x1e,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x7,0x80,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0xe,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1e,0x1,0xe0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0xf,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x3f,0xc0,0x70,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x7,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x7f,0xf0,0x38,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x7f,0xf8,0xc,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xff,0xfe,0x6,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0x2,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0x3,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x7f,0xff,0x3,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xfc,0x1e,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x84,0x7f,0xff,0x3,0x7,0xff,0xff,0xf0,
0xff,0xff,0xff,0xf8,0x7f,0x80,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc,0x7f,0xfe,0x2,0xf,0xff,0xff,0xf0,
0xff,0xff,0xff,0xf0,0xff,0xe0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1e,0x7f,0xfe,0x0,0xf,0xff,0xff,0xf0,
0xff,0xff,0xff,0xe1,0xff,0xf0,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1e,0x3f,0xfc,0x0,0x3,0xff,0xff,0xf0,
0xff,0xff,0xff,0xc3,0xff,0xf8,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x3e,0x1f,0xf0,0x0,0x1,0xff,0xff,0xf0,
0xff,0xff,0xff,0xc7,0xff,0xfc,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x3e,0xf,0xe0,0xf,0xe0,0xff,0xff,0xf0,
0xff,0xff,0xff,0x87,0xff,0xfe,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x7f,0x2,0x0,0x1f,0xf8,0x7f,0xff,0xf0,
0xff,0xff,0xff,0xf,0xff,0xfe,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x7f,0x80,0x0,0x3f,0xfc,0x7f,0xff,0xf0,
0xff,0xff,0xfe,0x1f,0xff,0xff,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x7f,0x80,0x0,0xff,0xfc,0x3f,0xff,0xf0,
0xff,0xff,0xf8,0x3f,0xff,0xff,0x80,0x3,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x7f,0xc0,0x3,0xff,0xfe,0x3f,0xff,0xf0,
0xff,0xff,0xc0,0x7f,0xff,0xff,0x80,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xf0,0xf,0xff,0xfe,0x3f,0xff,0xf0,
0xff,0xff,0x0,0xff,0xff,0xff,0xc0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0xf0,
0xff,0xfc,0x3,0xff,0xff,0xff,0xc0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0xf0,
0xff,0xf0,0x1f,0xff,0xff,0xff,0xe0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0xf0,
0xff,0xe0,0xff,0xff,0xff,0xff,0xe0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0xf,0xff,0xf0,
0xff,0xe1,0xff,0xff,0xff,0xff,0xf0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0x8f,0xff,0xf0,
0xff,0xc3,0xff,0xff,0xff,0xff,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0x8f,0xff,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xf8,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xff,0xff,0x8f,0xff,0xf0,
0xff,0x87,0xff,0xff,0xff,0xff,0xf8,0x0,0x7,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xfc,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xfc,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xfe,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xfe,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0x0,0x1,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0x80,0x1,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xf8,0x7f,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xc0,0x1,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xfc,0x3f,0xf0,
0xff,0x87,0xff,0xff,0xff,0xff,0xff,0xc0,0x3,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xff,0xff,0xff,0xff,0xfe,0x3f,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xe0,0x7,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xff,0xff,0xff,0xff,0xfe,0x1f,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xf0,0xf,0xff,0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xf,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xfc,0x3f,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xfe,0x1f,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xf,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xf,0xf0,
0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0xff,0xff,0xff,0xfe,0xf,0xff,0xff,0xff,0xff,0xff,0xfe,0x1f,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,0xff,0xff,0xf8,0xf,0xff,0xff,0xff,0xff,0xff,0xf8,0x3f,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xff,0xff,0xff,0xe0,0xf,0xff,0xff,0xff,0xff,0xff,0xf0,0x7f,0xf0,
0xff,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7f,0xff,0xff,0xff,0x80,0x1f,0xff,0xff,0xff,0xff,0xff,0xc0,0xff,0xf0,
0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x1f,0xff,0xff,0xfe,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0x3,0xff,0xf0,
0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x3,0xff,0xff,0xf0,0x0,0x1f,0xff,0xff,0xff,0xff,0xfc,0x7,0xff,0xf0,
0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x3f,0xfe,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xf0,0x1f,0xff,0xf0,
0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xc0,0x7f,0xff,0xf0,
0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0x1,0xff,0xff,0xf0,
0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xfc,0x7,0xff,0xff,0xf0,
0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xf8,0x1f,0xff,0xff,0xf0,
0xff,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xf0,0x7f,0xff,0xff,0xf0,
0xff,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xe0,0xff,0xff,0xff,0xf0,
0xff,0xe0,0xf,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0xc3,0xff,0xff,0xff,0xf0,
0xff,0xf0,0x0,0xf,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0xff,0x87,0xff,0xff,0xff,0xf0,
0xff,0xfc,0x0,0x0,0x7f,0xff,0xff,0xff,0xf8,0x0,0x1f,0xff,0xf0,0x0,0x3f,0xff,0xff,0xff,0xf,0xff,0xff,0xff,0xf0,
0xff,0xff,0xe0,0x0,0x7,0xff,0xff,0xff,0xf8,0x7,0xff,0xff,0xff,0xfe,0x1f,0xff,0xff,0xfe,0x1f,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xc0,0x0,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0xff,0xfc,0x3f,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0x0,0x3f,0xff,0xff,0xe1,0xff,0xff,0xff,0xff,0xff,0xf,0xff,0xff,0xf8,0x7f,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xf0,0xf,0xff,0xff,0xc3,0xff,0xff,0xff,0xff,0xff,0x8f,0xff,0xff,0xf0,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xfe,0x3,0xff,0xff,0x87,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0xff,0xc1,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xfe,0xf,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,0x83,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xe0,0x0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xfe,0x7,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0x0,0x3f,0xff,0xff,0xff,0xff,0xff,0xf0,0x7f,0xf8,0x1f,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x1,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xf,0x80,0x3f,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x3,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x3f,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0
};

// Setup
void setup() {
#if defined(ESP32)
  hspi.begin();
  tft.begin(hspi);
#else
  tft.begin();
#endif
  Serial.begin(9600);
}

// Loop
void loop() {
    
  tft.drawRectangle(0, 0, tft.maxX() - 1, tft.maxY() - 1, COLOR_WHITE);
  tft.setFont(Terminal6x8);
  tft.drawText(10, 10, "hello!");
  delay(1000);
  
  tft.clear();
  tft.drawText(10, 20, "clear");
  delay(1000);

  tft.drawText(10, 30, "text small");
  tft.setBackgroundColor(COLOR_YELLOW);
  tft.setFont(Terminal12x16);
  tft.drawText(90, 30, "BIG", COLOR_RED);
  tft.setBackgroundColor(COLOR_BLACK);
  tft.setFont(Terminal6x8);
  delay(1000);

  tft.drawText(10, 40, "setBacklight off");
  delay(500);
  tft.setBacklight(LOW);
  delay(500);
  tft.setBacklight(HIGH);
  tft.drawText(10, 50, "setBacklight on");
  delay(1000);

  tft.drawRectangle(10, 10, 110, 110, COLOR_BLUE);
  tft.drawText(10, 60, "rectangle");
  delay(1000);

  tft.fillRectangle(20, 20, 120, 120, COLOR_RED);
  tft.drawText(10, 70, "solidRectangle");
  delay(1000);

  tft.drawCircle(80, 80, 50, COLOR_YELLOW);
  tft.drawText(10, 80, "circle");
  delay(1000);

  tft.fillCircle(90, 90, 30, COLOR_GREEN);
  tft.drawText(10, 90, "solidCircle");
  delay(1000);

  tft.drawLine(0, 0, tft.maxX() - 1, tft.maxY() - 1, COLOR_CYAN);
  tft.drawText(10, 100, "line");
  delay(1000);

  for (uint8_t i = 0; i < 127; i++)
    tft.drawPixel(random(tft.maxX()), random(tft.maxY()), random(0xffff));
  tft.drawText(10, 110, "point");
  delay(1000);

  for (uint8_t i = 0; i < 4; i++) {
    tft.clear();
    tft.setOrientation(i);
    tft.drawRectangle(0, 0, tft.maxX() - 1, tft.maxY() - 1, COLOR_WHITE);
    tft.drawText(10, 10, "setOrientation (" + String("0123").substring(i, i + 1) + ")");
    tft.drawRectangle(10, 20, 50, 60, COLOR_GREEN);
    tft.drawCircle(70, 80, 10, COLOR_BLUE);
    tft.drawLine(30, 40, 70, 80, COLOR_YELLOW);
    delay(1000);
  }

  tft.setOrientation(0);
  tft.clear();
  tft.drawText(10, 100, "drawing bitmap");
  delay(1000);
  tft.clear();
  tft.setBackgroundColor(COLOR_BLACK);
  tft.drawBitmap(0, 0, tux, 180, 220, COLOR_WHITE);
  delay(5000);
  
  tft.setOrientation(0);
  tft.clear();
  tft.setFont(Terminal12x16);
  tft.setBackgroundColor(COLOR_YELLOW);
  tft.drawText(10, 40, "bye!", COLOR_RED);
  tft.setBackgroundColor(COLOR_BLACK);
  tft.setFont(Terminal6x8);
  delay(1000);
  
  tft.drawText(10, 60, "off");
  delay(1000);
  
  tft.setBacklight(false);
  tft.setDisplay(false);
  
  while(true);

}

Credits

Arnov Sharma

Arnov Sharma

308 projects • 306 followers
Just your average MAKER

Comments