Arduino/Seeeduino, Arduino Mega, and Seeeduino Mega compatible 2.8 Size QVGA Display Resistive Touch Screen



Similar documents
3.2 inch QVGA TFT Color LCD User s Guide Version 1 & 2

UniOP epad33 and epad33t

HMIGTO4310 advanced touchscreen panel 640 x 480 pixels VGA- 7.5" - TFT - 96 MB

Specification of 5 Wire Analog Touch Panel

2.2" TFT Display. Created by Ladyada. Last updated on :15:09 PM EDT

Introduction to graphics and LCD technologies. NXP Product Line Microcontrollers Business Line Standard ICs

1. General Description

Touch Screen for Pictiva OLED display. Application Note. Introduction

Three Axis TB6560 CNC Driver Users Manual

Touchscreen Driver Installation. Introduction Specification Installation - for Windows 95/98 - for Windows NT - for Windows 2000/XP - for DOS

Programmable Terminal. NPSeries. Easy Setup with the Low-cost, Compact NP Series

Embedded Systems Design Course Applying the mbed microcontroller

Second Display Installation Guide Point-of-Sale Hardware System

Renewable Energy Monitor User Manual And Software Reference Guide. (979)

Revision History. Date Page Summary. Approved By: Document Number: OG24161 r.0 Page 1 of 11

MA107 Precalculus Algebra Exam 2 Review Solutions

Contents & P-LCD Modules Cross Reference Table

Features. Introduction. Applications. VPD-130/VPD-130N with DIN-Rail Mounting. VPD-130/VPD-130N Panel Mounting. Excellent C/P ratio (cost/performance)

LCD Module Product Specification

Fingerprint Based Biometric Attendance System

Using the Siemens S65 Display

EMERGING DISPLAY CUSTOMER ACCEPTANCE SPECIFICATIONS 16290(LED TYPES) EXAMINED BY : FILE NO. CAS ISSUE : JUL.03,2001 TOTAL PAGE : 7

Kit for TLM051 monitor

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

LMB162ABC LCD Module User Manual

V350-R34 V350J-R34. npn inputs pnp inputs

Pop. Parker operator panels. Pop CANopen. Compax3 I21T11 CANopen. with integrated axis. standalone SMH/MH. CANopen. digital inputs & outputs

Character LCDs. Created by Ladyada. Last updated on :45:29 PM EDT

Four/Five Axis TB6560 CNC Driver Users Manual

e-4 AWT07MLED 7 Q TFT LCD MONITOR (LED Backlighted) USER MANUAL

1.8" TFT Display Breakout and Shield

TFT LCD Specification. Model NO.: OSD080TN42

LCD240X128A Asansörler İçin Grafik LCD Gösterge Graphic LCD Display for Elevators

EMERGING DISPLAY CUSTOMER ACCEPTANCE SPECIFICATIONS 16400(LED TYPES) EXAMINED BY : FILE NO. CAS ISSUE : JAN.19,2000 TOTAL PAGE : 7 APPROVED BY:

3.2 inch Arduino LCD Shield User Guide

NHD-0420D3Z-FL-GBW-V3

PRDUCT SPECIFICATON TFT LCD MODULE Model : ELT240320ATP

HP ProDisplay P19A LED Backlit Monitor. User Guide

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

0.43" Single Character DLO4135/DLG " Single Character DLO7135/DLG x 7 Dot Matrix Intelligent Display Devices with Memory/Decoder/Driver

EMERGING DISPLAY CUSTOMER ACCEPTANCE SPECIFICATIONS (LED TYPES) EXAMINED BY : FILE NO. CAS ISSUE : DEC.01,1999 TOTAL PAGE : 7 APPROVED BY:

Vision OPLC. V R34/V350-J-R34 Technical Specifications. Technical Specifications

Servo Motor API nxt_motor_get_count nxt_motor_set_count nxt_motor_set_speed

Note monitors controlled by analog signals CRT monitors are controlled by analog voltage. i. e. the level of analog signal delivered through the

O pen F ram e Tou c h M on i t or

128x64 DOTS. EA DOGL128x-6 EA LED68X51-RGB

AR1100 Resistive Touch Screen Controller Guide

User manual LCD 240-2xx

LCD I 2 C/Serial RX Backpack. Data Sheet. LCD to I2C/Serial RX Backpack I2C or Serial RX communication with Standard 16 Pin LCD modules

Qingdao Guihe Measurement&Control Technology Co., Ltd. Automatic Tank Gauging System, Magnetostrictive Diesel fuel tank level gauge

MI4 - Operator Panel : Engineering

EA7-T8C EA7-T10C EA7-T12C EA7-T15C

LCD Module Product Specification

Encoders. the incremental encoders format such as relective optical technology, transmissive optical technology

Easy Installation All five standard monitors fit into shallow mounting areas, requiring about 3" of depth. The XT1502, SXT1811, and SXT2011 models hav

FLOOR INDICATORS CATALOGUE

STIM202 Evaluation Kit

VOLTAGE/CURRENT CALIBRATOR ISO-TECH ILC-421

LCM NHD-12032BZ-FSW-GBW. User s Guide. (Liquid Crystal Display Graphic Module) RoHS Compliant. For product support, contact

USER MANUAL MODEL

TouchKit Software User manual for Windows 7 Version:

Wireless Security Camera

FLOOR INDICATORS CATALOGUE 2007

Data Sheet. HCMS-235x CMOS Extended Temperature Range 5 x 7 Alphanumeric Display. Features. Description. Typical Applications

8 by 8 dot matrix LED displays with Cascadable Serial driver B32CDM8 B48CDM8 B64CDM8 General Description

Hand-held thermometer Model CTH7000

Board also Supports MicroBridge

T Substation Maintenance and Commissioning Test Equipment

Tobii AB. Accuracy and precision Test report. Tobii Pro X3-120 fw Date: Methodology/Software version: 2.1.7*

Embedded & Industrial PCs International Products and Configurations INDEX

Thermistor. Created by Ladyada. Last updated on :30:46 PM EDT

Appearance Type Setting distance Sensing area Model Remarks Camera with lighting. 34mm to 49mm 5mm x 4.9mm to 9mm x 8.

OLED into Mobile Main Display

T-SERIES INDUSTRIAL INCLINOMETER ANALOG INTERFACE

FLOOR INDICATORS CATALOGUE 2007

A-307. Mobile Data Terminal. Android OS Platform Datasheet

HP Compaq LE1902x, LE2002x, LE2002xm, and LE2202x LED Backlit LCD Monitors. User Guide

Displays 2 x 24 Character Serial Display Module

Senses SV series industrial monitor user manual

Automatic tank gauge system ATGs for petrol stations, diesel fuel tank level gauge, tank gauging system, magnetostrictive probe

User s Guide DDS-3X25 USB ARBITRARY FUNCTION GENERATOR

Application & Quick-Start Guide

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

0.9V Boost Driver PR4403 for White LEDs in Solar Lamps

Ultrasonic Distance Measurement Module

LCD MODULE DEM SYH-LY

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

Tobii Technology AB. Accuracy and precision Test report. X2-60 fw Date: Methodology/Software version: 2.1.7

Touch HMI Devices. The Best Choice for Building/Factory/Machine/Home Automation. Introduction. Features. Touch HMI Devices.

Product Information S N O. Portable VIP protection CCTV & Alarm System 2

Transmitter Interface Program

Instant Graphical User Interface Solutions Why you need a new User Interface

Material: Weight: Bearing Life: Shaft Speed: Starting Torque: Mass Moment of Inertia: Shaft Loads:

In-Sight Hardware specifications

CATIA Drafting TABLE OF CONTENTS

Neo-Neon. LED Vision Mesh Screen Operation Manual. LED Vision Mesh Screen. Neo-Neon International Ltd He Shan Decorative Lighting Company Limited

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

First Bytes Programming Lab 2

1602 LCD adopts standard 14 pins(no backlight) or 16pins(with backlight) interface, Instruction of each pin interface is as follows:

Transcription:

2.8'' TFT Touch Shield Introduction 2.8" TFT Touch Shield is an Arduino / Arduino Mega compatible multicolored TFT display with a 4-wire resistive touch screen. It includes an Arduino shield compatible footprint for attachment. The TFT driver is based on professional Driver IC and with 8 bit data and 4 bit control interface. Features Arduino/Seeeduino, Arduino Mega, and Seeeduino Mega compatible 2.8 Size QVGA Display Resistive Touch Screen Specification Item Min Typical Max Unit Voltage 4.5 5 5.5 VDC Current / / 250 ma LCD Panel Size 2.8 inch View angle 60~120 Deg Resolution 320x240 / LCD color 65k / Backlight Type LED / LCD driver IC ST7781R / Interface Type 10±2 g Interface Type Parallel port ( 8bit Data + 4bit Control ) / Touch Screen 4-Wire resistive touch screen / Active area 43.2*57.3 mm ESD contact discharge ±4 KV ESD air discharge ±8 KV Dimension 72.5x54.7x18 mm Weight 24±2 g

Cautions Do not subject the module to mechanical shock or impact by dropping it. Do not apply excessive force to the display surface or the adjoining areas since this may cause the color tone to vary. Pins usage on Arduino D0 - Unused. D1 - Unused. D2 - LCD data bit 8. D3 - LCD data bit 9. D4 - LCD data bit 10. D5 - LCD data bit 11. D6 - LCD data bit 12. D7 - LCD data bit 13. D8 - LCD data bit 14. D9 - LCD data bit 15.

D10 - LCD CS pin, active low. D11 - LCD RS pin. D12 - LCD WR pin. D13 - LCD RD pin. D14(A0) - Touch Screen Y-. D15(A1) - Touch Screen X-. D16(A2) - Touch Screen Y+. D17(A3) - Touch Screen X+. D18(A4) - Unused. D19(A5) - Unused. Usage Hardware Installation Insert the TFT Touch Shield to Seeeduino as shown below.

TFT Programming The TFT library provides the following Application Programming Interfaces(API). The library makes use of direct access to PORT registers instead of Arduino APIs. This is to increase the speed of communication between MCU and TFT. At present, the library supports Arduino, Arduino Mega (1280 or 2560) and Seeeduino ADK Main Board compatible boards. In Mega the 8bit data port of TFT is distributed to different pins belonging to different ports. This decreases the speed of graphics drawing when compared to Arduino. The choice of port pins are purely based on Arduino / Mega port pin arrangement. General Functions setxy(unsigned int pox, unsigned int poy) Sets the cursor position to (pox,poy). This function is internally used by other graphics APIs. setpixel(unsigned int pox, unsigned int poy,unsigned int color) Sets the (pox,poy) pixel to color color. This function is internally used by other graphics APIs. Lines drawline(unsigned int x0,unsigned int y0,unsigned int x1,unsigned int y1,unsigned int color) Draws a line from pixel (x0,y0) to pixel (x1,y1) with color color. drawverticalline(unsigned int pox, unsigned int poy,unsigned int length,unsigned int color) Draws a Horizontal Line of length length with color color starting from pixel (pox,poy). drawhorizontalline(unsigned int pox, unsigned int poy,unsigned int length,unsigned int color) Draws a Vertical Line of length length with color color starting from pixel (pox,poy).

Rectangle drawrectangle(unsigned int pox, unsigned int poy, unsigned int length,unsigned int width,unsigned int color) Draws a rectangle starting from (pox,poy) of length length, width width and color color. fillrectangle(unsigned int pox, unsigned int poy, unsigned int length, unsigned int width, unsigned int color) Draws a filled rectangle starting from pixel (pox,poy) of length length, width width and color color. Circle drawcircle(int pox, int poy, int r,unsigned int color) Draws a circle at (pox,poy) of radius radius and color color. fillcircle(int pox, int poy, int r,unsigned int color) Draws a filled circle at (pox,poy) of radius radius and color color. Text drawchar(unsigned char ascii,unsigned int pox, unsigned int poy,unsigned int size, unsigned int fgcolor) Draws a character starting from (pox,poy) using inbuilt font of size size and with color fgcolor. This function is used by drawstring() function. drawstring(char *string,unsigned int pox, unsigned int poy,unsigned int size,unsigned int fgcolor)

Draws a string of text starting from (pox,poy) using inbuilt font of size size and with color fgcolor. TouchScreen Programming TFT Touch Shield uses the Adafruit Touch Screen Library. To understand the principle behind resistive touch screen refer External Links. In short, a 4-wire resistive touch screen provides two voltage divider each for X and Y axis. By applying proper voltages for each axis and scanning the ADC values the position of the touch can be detected. These values are always prone to noise. Hence a digital filter is used. To use the TouchScreen Library first create a TouchScreen object by TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); Where XP, YP, XM and YM are ADC port pins connected to XPlus, YPlus, XMinus and YMinus pins of Touch Screen. 300 is the resistance across X plates. Read the Raw ADC value using Point p = ts.getpoint(); The Raw ADC value has to be converted to Pixel Co-ordinates. This is done with map function. This mapping changes for v0.9 and v1.0. The demo applications already takes care of this mapping. p.x = map(p.x, TS_MINX, TS_MAXX, 240, 0); p.y = map(p.y, TS_MINY, TS_MAXY, 320, 0); The following sketch demonstrates use of TouchScreen Library. This can also be used to calibrate the touch screen co-ordinates. Compile and upload the sketch. Open serial port monitor and touch the points displayed on the screen. See if the displayed X and Y values are correct. If not, we have to re-calibrate the touch screen coordinates. How to calibrate the touch screen? The parameters TS_MINX, TS_MAXX, TS_MINY and TS_MAXY actually decides the extreme ends of the touch screen and actually forms the calibration parameters.

The values assigned to these variables are measured ADC values (i.e Raw X, Raw Y) when we touch the extreme diagonal ends of touch screen. Touch points (0,0) and (239,319) and note down Raw X and Raw Y values. For better accuracy, try out many times and find the right value. TS_MINX corresponds to ADC value when X = 0 ; TS_MINY corresponds to ADC value when Y = 0 ; TS_MAXX corresponds to ADC value when X = 240-1 i.e 239 ; TS_MAXY corresponds to ADC value when Y = 320-1 i.e 319 ; Change these parameters in the sketch, recompile and upload to Arduino. Repeat the above steps if you still do not get accurate values. Touch Screen Demo Sketch #include <stdint.h> #include <TouchScreen.h> #include <TFT.h> //Measured ADC values for (0,0) and (240-1,320-1) //TS_MINX corresponds to ADC value when X = 0 //TS_MINY corresponds to ADC value when Y = 0 //TS_MAXX corresponds to ADC value when X = 240-1 //TS_MAXY corresponds to ADC value when Y = 320-1 static unsigned int TS_MINX, TS_MAXX, TS_MINY, TS_MAXY; //Touch Screen Co-ordinate mapping register static unsigned int MapX1, MapX2, MapY1, MapY2;

// For better pressure precision, we need to know the resistance // between X+ and X- Use any multimeter to read it // The 2.8" TFT Touch shield has 300 ohms across the X plate /* Usage: TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); Where, XP = X plus, YP = Y plus, XM = X minus and YM = Y minus */ //init TouchScreen port pins. This would be reinitialized in setup() based on the hardware detected. TouchScreen ts = TouchScreen(17, A2, A1, 14, 300); void setup(void) { Tft.init();//init TFT inittouchscreenparameters(); //initializes Touch Screen parameters based on the detected TFT Touch Schield hardware //Lines Tft.drawLine(0,0,50,50,RED);//draw a 45degree red line point(0,0) to point(50,50) Tft.drawVerticalLine(25,0,50,GREEN);//draw a vertical green line point(25,0) to point(25,50) Tft.drawHorizontalLine(0,25,50,BLUE);//draw a horizontal blue line point(0,25) to point(50,25) //Rectangle Tft.drawRectangle(50,0,80,50,WHITE);//draw a white rectangle, length=80(x-axis), width=50(y-axis) Tft.fillRectangle(0,50,50,80,CYAN);//fill a cyan rectangle, length=50(x-axis), width=80(y-axis) //Circle

Tft.drawCircle(75,75,25,RED);//draw a red circle, circle centre(75,75) radius=25 Tft.fillCircle(150,100,50,GREEN);//fill a green circle, circle centre(150,100) radius=50 //Text Tft.drawChar('S',0,150,2,RED);//draw a char, start from point(0,150) font size 2(16*16) Tft.drawString("Seeed Studio",8,166,2,GREEN);//draw a char, start from point(8,166) font size 2(16*16) } void loop(void) { // a point object holds x y and z coordinates Point p = ts.getpoint(); p.x = map(p.x, TS_MINX, TS_MAXX, MapX1, MapX2); p.y = map(p.y, TS_MINY, TS_MAXY, MapY1, MapY2); // we have some minimum pressure we consider 'valid' // pressure of 0 means no pressing! if (p.z > ts.pressurethreshhold) { //p.x; //p.y; //p.z; Tft.fillCircle(p.x,p.y,2,GREEN); }

} void inittouchscreenparameters() { //This function initializes Touch Screen parameters based on the detected TFT Touch Schield hardware if(tft.ic_code == 0x5408) //SPFD5408A TFT driver based Touchscreen hardware detected { #if defined( AVR_ATmega1280 ) defined( AVR_ATmega2560 ) ts = TouchScreen(54, A1, A2, 57, 300); //init TouchScreen port pins #else ts = TouchScreen(14, A1, A2, 17, 300); //init TouchScreen port pins #endif //Touchscreen parameters for this hardware TS_MINX = 120; TS_MAXX = 910; TS_MINY = 120; TS_MAXY = 950; MapX1 = 239; MapX2 = 0; MapY1 = 0; MapY2 = 319; } else //ST7781R TFT driver based Touchscreen hardware detected

{ #if defined( AVR_ATmega1280 ) defined( AVR_ATmega2560 ) ts = TouchScreen(57, A2, A1, 54, 300); //init TouchScreen port pins #else ts = TouchScreen(17, A2, A1, 14, 300); //init TouchScreen port pins #endif //Touchscreen parameters for this hardware TS_MINX = 140; TS_MAXX = 900; TS_MINY = 120; TS_MAXY = 940; MapX1 = 239; MapX2 = 0; MapY1 = 319; MapY2 = 0; } } Demo Code shown Insert the TFT Touch Shield to Seeeduino as shown below.