#include "TFT_eSPI.h"
#include "Free_Fonts.h"
TFT_eSPI tft;
unsigned char Words[]={
/*-- 文字: 人 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x02,0x04,0x08,0x30,0xC0,0x00,0x00,0x00,0xC0,0x30,0x08,0x04,0x02,0x01,0x00,
/*-- 文字: 人 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x02,0x04,0x08,0x30,0xC0,0x00,0x00,0x00,0xC0,0x30,0x08,0x04,0x02,0x01,0x00,
/*-- 文字: 都 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x04,0x24,0x24,0x25,0xFE,0x24,0x2C,0x14,0x64,0x04,0x7F,0x40,0x44,0x5B,0x60,0x00,
0x20,0x40,0xFF,0x92,0x92,0x92,0x92,0xFF,0x00,0x00,0xFF,0x10,0x08,0x10,0xE0,0x00,
/*-- 文字: 懂 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x07,0x00,0xFF,0x08,0x04,0x44,0x55,0xF5,0x55,0x5F,0x55,0xF5,0x55,0x44,0x40,0x00,
0x80,0x00,0xFF,0x00,0x01,0x05,0xF5,0x55,0x55,0xFF,0x55,0x55,0xF5,0x05,0x01,0x00,
/*-- 文字: 物 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x02,0x3C,0x08,0xFF,0x08,0x08,0x04,0x08,0xF1,0x1E,0x10,0x1F,0x10,0x1F,0x00,0x00,
0x40,0x60,0x40,0xFF,0x80,0x80,0x20,0x42,0x84,0x18,0x62,0x81,0x02,0xFC,0x00,0x00,
/*-- 文字: 联 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x7F,0x49,0x49,0x7F,0x40,0x00,0x08,0x88,0x68,0x0F,0x28,0xC8,0x08,0x00,0x00,
0x08,0xF8,0x10,0x10,0xFF,0x20,0x81,0x82,0x8C,0xB0,0xC0,0xB0,0x8C,0x82,0x81,0x00,
/*-- 文字: 网 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x7F,0x40,0x44,0x42,0x41,0x4E,0x40,0x44,0x42,0x41,0x4E,0x40,0x7F,0x00,0x00,
0x00,0xFF,0x08,0x10,0x60,0x80,0x70,0x08,0x10,0x60,0x80,0x72,0x01,0xFE,0x00,0x00,
};
void ShowChinese(unsigned char x, unsigned char y, unsigned int index, unsigned int color)
{
unsigned char t, i, addr = 0;
unsigned char w = 0;
for (t=0; t<16; t++) {
w = Words[32 * index + t];
for (i=0; i<8; i++) {
if (w & 0x80) tft.drawPixel(x+t, y+i, color);
w = w << 1;
}
}
y = y + 8;
for (t=0; t<16; t++) {
w = Words[32 * index + t + 16];
for (i=0; i<8; i++) {
if (w & 0x80) tft.drawPixel(x+t, y+i, color);
w = w << 1;
}
}
}
void setup()
{
Serial.begin(115200);
tft.begin();
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);
ShowChinese(90, 100, 0, TFT_RED);
ShowChinese(110, 100, 1, TFT_ORANGE);
ShowChinese(130, 100, 2, TFT_YELLOW);
ShowChinese(150, 100, 3, TFT_GREEN);
ShowChinese(170, 100, 4, TFT_BLUE);
ShowChinese(190, 100, 5, TFT_CYAN);
ShowChinese(210, 100, 6, TFT_MAGENTA);
tft.setFreeFont(FM9);
tft.setCursor((320 - tft.textWidth("www.getiot.tech"))/2, 150);
tft.print("www.getiot.tech");
}
void loop() {}