17.01.2015 Views

ThaiEasyElec - 2.8 inch TFT Touch Shield User ... - ThaiEasyElec.net

ThaiEasyElec - 2.8 inch TFT Touch Shield User ... - ThaiEasyElec.net

ThaiEasyElec - 2.8 inch TFT Touch Shield User ... - ThaiEasyElec.net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ชุดคําสั งใช้งาน แสดงผล LCD<br />

การเรียกใช้งาน Library <strong>TFT</strong>_LCD<br />

- เรียกใช้งาน Library <strong>TFT</strong> LCD โดยประกาศ #include <br />

- กําหนดตัวแปร Class เช่น <strong>TFT</strong>_LCD lcd;<br />

; หมายเหตุ ในการยกตัวอย่างการใช้งานใน ฟังก์ชัน ต่างๆจะสมมติให้ใช้ ตัวแปร Class คือ lcd<br />

ฟังก์ชั น การตังค่าการแสดงผลหน้าจอ<br />

void <strong>TFT</strong>_LCD::init(hor_ver mode)<br />

ฟังก์ชัน นี ใช้สําหรับ กําหนดการแสดงผลหน้าจอในรูปแบบ แนวตั ง หรือ แนวนอน โดยสามารถกําหนดได้ 2 แนวคือ<br />

VERTICAL และ HORIZONTAL<br />

ตัวอย่างการใช้งาน<br />

lcd.init(HORIZONTAL); // กําหนดให้แสดงผลทีหน้าจอในแนวนอน<br />

lcd.init(VERTICAL); // กําหนดให้แสดงผลทีหน้าจอในแนวตั ง<br />

ฟังก์ชั น เคลียร์หน้าจอ<br />

void <strong>TFT</strong>_LCD:: ClearScreen(unsigned short color)<br />

ฟังก์ชัน นี ใช้สําหรับ เคลียหน้าจอ โดยสามารถกําหนดสีให้กับหน้าจอได้ โดย Library ได้ Define ค่าสีพื นฐานเอาไว้ให้<br />

เช่น<br />

#define TS_COL_RED<br />

#define TS_COL_GREEN<br />

#define TS_COL_BLUE<br />

#define TS_COL_YELLOW<br />

#define TS_COL_PURPLE<br />

0x001F<br />

0x07E0<br />

0xF800<br />

0x07FF<br />

0xF81F<br />

7 <strong>ThaiEasyElec</strong> - <strong>2.8</strong> <strong>inch</strong> <strong>TFT</strong> <strong>Touch</strong> <strong>Shield</strong> user manual V1.0| Venus Supply Co.,ltd - Contact : Sales@thaieasyelec.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!