extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(QD220A, A2,A1,A5,A4,A3); // UTFT myGLCD(Model,SDI,CLK,CS,RST[,RS]);
```
以下是輸出文字或圖形的指令
```
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setFont(SmallFont);
myGLCD.setColor(255, 0, 0); //(r,g,b)
myGLCD.print("ABCDE", x,y); //x,y:輸出文字左上角座標
myGLCD.drawLine(0,0,220,176); //(x1,y1,x2,y2) x1,y1 起點座標 x2,y2 終點座標
myGLCD.drawPixel (x,y); //點座標
myGLCD.drawCircle(x, y, r); //x,y,半徑
myGLCD.drawRect(0, 14, 219, 161); //(x1,y1,x2,y2) x1,y1 矩形rectangle左上起點座標 x2,y2 對角終點座標
myGLCD.drawRoundRect(0, 14, 219, 161); //(x1,y1,x2,y2)
myGLCD.fillRect(0, 0, 219, 13); ////(x1,y1,x2,y2)
myGLCD.fillRoundRect(132-(i*15), 23+(i*15), 172-(i*15), 63+(i*15)); //()
myGLCD.fillCircle(x,y,r); //x,y:圓心
```
二、輸出文字
```
#include
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(QD220A, A2,A1,A5,A4,A3); // UTFT myGLCD(Model,SDI,CLK,CS,RST[,RS]);
void setup() {
myGLCD.InitLCD();
}
void loop() {
myGLCD.clrScr();
myGLCD.setFont(SmallFont);
myGLCD.setColor(255, 0, 0);
myGLCD.print("ABCDE",110,88);
delay(2000);
}
```
可以用 BigFont 來試看看會更明顯,座標表示如下圖,220x176的TFT液晶,x座標由 0→220,y座標由0→176...?對嗎?
![](http://maker.tn.edu.tw/uploads/tad_book3/image/IMG_20181203_143448.jpg)
練習:試著用 SevenSegNumFont 顯示七段顯示器的數字
三、輸出圖案
```
void loop() {
myGLCD.clrScr();
myGLCD.setFont(BigFont);
myGLCD.setColor(255, 0, 0);
myGLCD.print("ABCDE",110,88);
myGLCD.setFont(SevenSegNumFont);
myGLCD.setColor(255, 255, 0);
myGLCD.print("8",55,44);
myGLCD.setColor(255, 0, 255);
myGLCD.drawLine(0,0,219,87);
myGLCD.drawLine(0,88,219,175);
myGLCD.setColor(0, 255, 255);
myGLCD.drawCircle(109, 87, 87); //x,y:圓心
delay(2000);
}
```
![](http://maker.tn.edu.tw/uploads/tad_book3/image/IMG_20181203_151501.jpg)
四、進階練習
輸出中文