Read tft_lcd_mega_v1.0.pdf text version

2.4"/2.8" TFT LCD shield for Arduino Mega

www.nuelectronics.com

2.4" TFT LCD with touchscreen, for Arduino mega

2.8" TFT LCD with touchscreen, for Arduino mega

The 2.4" and 2.8" TFT color LCD shields with touch screen interface are the latest addition to our Arduino shields family. Its large (320x240) screen resolution, 65K color space and touchscreen interface are ideal for developing nice user interface device. www.nuelectronics.com V1.0 28/07//2010

Features · 2.4 / 2.8 inch TFT LCD with ILI9325 controller - 320x240 resolution and 65K color · Touch-screen Panel and on-board AD7843 compatible controller · SD card interface in SPI mode, for external mass storage of photos and icons. · Directly plug into Arduino Mega boards · Arduino library and exmaples of graphic and font routines, touchscreen interface and calibration, and FAT filesystem on SD card.

Physical Dimension 78.5mm

Y Y

(320,240) ­ 2.8" TFT (320, 240) ­ 2.4" TFT

56.5mm

(0,0) ­ 2.4" TFT

x

X

(0,0) ­ 2.8" TFT

The graph above shows the physical dimension of the 2.8" and 2.4" www.nuelectronics.com V1.0 28/07//2010

TFT LCD shield. It also shows the start point and end point of the LCD at its default horizontal orientation.

TFT_lib library for Arduino MegaThe TFT_lib library can be download and used on Arduino platform. It includes several classes for different tasks · LCD class in TFT_ILI9325.cpp, defines ILI9325 controller register setting, and hardware related basic graphic functions. Graphics class in TFT_Graphics.cpp, is baased on LCD class and defines high-level advanced graphic functions. TFT_Font class in TFT_Font.cpp, is based on LCD class and defines font drawing functions. It can handle fixed and variable width fonts in either uncompressed or compressed format. User can generate or import Windows font by using H. Reddmann's Font editor program. Touchpanel class in touchpanel.cpp, defines functions that initialize and read Touchscreen points. TFT_PFF class in TFT_PFF.cpp, is a wrap class for the Petit FatFs. The Petit FatFs implements a FAT filesystem for embedded system with very limited Flash and RAM spaces.

·

·

·

·

Key user functions in TFT-lib The following list shows key user functions in the TFT-lib -Graphics class -// set cursor to x, y void SetCursor(uint16_t x, uint16_t y); // clear screen with color void ClearScreen(uint16_t color = WHITE);

www.nuelectronics.com

V1.0 28/07//2010

// fast draw a solid rectangle with color void FastSolidRect(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color); // Draw a line from x1,y1 to x2,y2 with color; x1<x2, y1<y2 void DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color); // Draw a rectangle of (width, height) from (x,y) with color, fill=0 ­ draw // outline, fill = 1 ­ solid draw void DrawRect(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color, uint8_t fill); // Draw a round-rectangle from (x1,y1) to (x2,y2) with round edge specified // by radius and color, fill=0 ­ draw outline, fill = 1 ­ solid draw void DrawRoundRect(uint16_t x, uint16_t y, uint16_t x2, uint16_t y2, uint16_t radius, uint16_t color, uint8_t fill);

// draw a pixel at (x,y) with color void DrawPixel(uint16_t x, uint16_t y, uint16_t color); //Draw a circle at center (x,y) with radius and color, fill=0 ­ draw outline, //fill=1 solid draw void DrawCircle(uint16_t x, uint16_t y, uint16_t radius, uint16_t color, uint8_t fill); // hardware vertical scroll void VerticalScroll(int16_t y);

TFT_Font class ­

// set font color with fColor (font color), bColor- background color, //Transparent =0, draw background color; Transparent=1 ­ don't draw //background color void set_Color(uint16_t fColor, uint16_t bColor, uint8_t Transparent); // set cursor to x, y void set_Cursor(uint16_t x, uint16_t y); // select font, support fixed/variable font, compressed or uncompressed. void set_Font(uint8_t *p_font); // print a character at current cursor position void putChar(char c); // calculate char width uint8_t CharWidth(char c); //print ROM string at current cursor position void putstr_P(char *str); // calculate ROM string width

www.nuelectronics.com

V1.0 28/07//2010

uint16_t str_Width_P(char *str); // Print RAM string at current cursor position void putstr(char *str); // calculate RAM string width uint16_t str_Width(char *str); // Print integer value void putnumber(long n);

Touchpanel functions -// read calibration matrix from Arduino EEPROM void get_matrix(void); // save calibration matrix to Arduino EEPROM void save_matrix(void); // read raw touchpanel points from touchpanel controller POINT* read_tp_point(void); // get calibrated lcd points POINT* read_lcd_point(void);

www.nuelectronics.com

V1.0 28/07//2010

Schematic ­

www.nuelectronics.com

V1.0 28/07//2010

Information

6 pages

Find more like this

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

269174