TFT touch screen with the use of Arduino: Print Screen Type

0
6651

Introduction

[nextpage title=”Introduction” ]

Hello friends of the screen will user in this paper with the Arduino with you touch TFT screen font to print  the application in SSD1289 LCD driver with 320 × 240 pixels and 65K-16 bit color resolution TFT screen Ramada programming card as the Arduino mega in I’m going to use front and rear faces shown.

TFT touch screen 1TFT touch screen 2

[/nextpage]

 

Pin Diagram

[nextpage title=”Pin Diagram” ]

The touch screen pins are given below.

TFT touch screen 3

TFT screen and the Arduino MEGA contact pins are given below.

TFT touch screen 4

[/nextpage]

 

Program

[nextpage title=”Program” ]

#include "UTFT.h"
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ITDB32S,38,39,40,41);
void setup()
{
 myGLCD.InitLCD(LANDSCAPE);
 myGLCD.clrScr();
}
void bigFontTest()
{
 myGLCD.clrScr();
 myGLCD.setColor(255, 0, 0);
 myGLCD.setBackColor(0, 0, 0);
 myGLCD.setFont(BigFont);
 myGLCD.print("ABCDEFGHIJKLMNOPQRST", LEFT, 0);
 myGLCD.print("UVWXYZ[\\]^_ABCDEFGH", LEFT, 16);
 myGLCD.print("0123456789:;<=>?0123", LEFT, 32);
 myGLCD.print("`abcdefghijklmnopqrs", LEFT, 48);
 myGLCD.print("tuvwxyz{|}~ 01234567", LEFT, 64);
 myGLCD.print("ABCDEFGHIJKLMNOPQRST", LEFT, 80);
 myGLCD.print("~~~~~~~~~~~~~~~~~~~~", LEFT, 96);
 myGLCD.print("UVWXYZ[\\]^_ABCDEFGH", LEFT, 112);
 myGLCD.print("0123456789:;<=>?0123", LEFT, 128);
 myGLCD.print("`abcdefghijklmnopqrs", LEFT, 144);
 myGLCD.print("tuvwxyz{|}~ 01234567", LEFT, 160);
 myGLCD.print("ABCDEFGHIJKLMNOPQRST", LEFT, 176);
 myGLCD.print("UVWXYZ[\\]^_ABCDEFGH", LEFT, 192);
 myGLCD.print("0123456789:;<=>?0123", LEFT, 208);
 myGLCD.print("`abcdefghijklmnopqrs", LEFT, 224);
}
void smallFontTest()
{
 myGLCD.clrScr();
 myGLCD.setColor(0, 255, 0);
 myGLCD.setBackColor(0, 0, 0);
 myGLCD.setFont(SmallFont);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 0);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 12);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 24);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 36);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 48);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 60);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 72);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 84);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 96);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 108);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 120);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 132);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 144);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 156);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 168);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 180);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 192);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 204);
 myGLCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn", LEFT, 216);
 myGLCD.print("opqrstuvwxyz[\\]^_0123456789`:;<=>?012345", LEFT, 228);
}
void hugeFontTest()
{
 myGLCD.clrScr();
 myGLCD.setColor(0, 0, 255);
 myGLCD.setBackColor(0, 0, 0);
 myGLCD.setFont(SevenSegNumFont);
 myGLCD.print("0123456789", LEFT, 0);
 myGLCD.print("0123456789", LEFT, 50);
 myGLCD.print("0123456789", LEFT, 100);
 myGLCD.print("0123456789", LEFT, 150);
}
void loop()
{
 smallFontTest();
 delay(1000);
 bigFontTest();
 delay(1000);
 hugeFontTest();
 delay(1000);
}

 

TFT touch screen 5

#include<UTFT.h>
// kullanılacak fontlar bildiriliyor.
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
// bu değerler kullandığınız dokunmatik ekranın özelliğine göre değişebilir.
UTFT myGLCD(ITDB32S,38,39,40,41);
void setup()
{
myGLCD.InitLCD(); //LCD ekran kurulumu yapılıyor
myGLCD.clrScr(); //Ekran temizlenir
myGLCD.setColor(VGA_BLUE); //yazılan degerin rengi
//myGLCD.setColor(0,0,255) bu şekildede kullanılır
myGLCD.setBackColor(255,0,0); //yazının arka plan rengi
myGLCD.fillScr(30,60,120); //Ekranı belirtilen renkte basar
myGLCD.setFont(BigFont);
myGLCD.print("ROBOTURKA.COM", CENTER, 50);
myGLCD.setFont(BigFont);
myGLCD.print("MUHAMMET OZCAN", CENTER, 150);
}
void loop()
{
//while(1) { };
}
TFT touch screen 6

#include <UTFT.h>
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ITDB32S,38,39,40,41);
void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
}
void loop()
{
myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 0);
myGLCD.setFont(BigFont);
myGLCD.print(" !\"#$%&'()*+,-./", CENTER, 0);
myGLCD.print("0123456789:;<=>?", CENTER, 16);
myGLCD.print("@ABCDEFGHIJKLMNO", CENTER, 32);
myGLCD.print("PQRSTUVWXYZ[\\]^_", CENTER, 48);
myGLCD.print("`abcdefghijklmno", CENTER, 64);
myGLCD.print("pqrstuvwxyz{|}~ ", CENTER, 80);
myGLCD.setFont(SmallFont);
myGLCD.print(" !\"#$%&'()*+,-./0123456789:;<=>?", CENTER, 120);
myGLCD.print("@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_", CENTER, 132);
myGLCD.print("`abcdefghijklmnopqrstuvwxyz{|}~ ", CENTER, 144);
myGLCD.setFont(SevenSegNumFont);
myGLCD.print("0123456789", CENTER, 190);
while(1) {};
}
TFT touch screen 7

#include "UTFT.h"
extern uint8_t BigFont[];
UTFT myGLCD(ITDB32S,38,39,40,41);
void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
}
void loop()
{
myGLCD.clrScr();
myGLCD.setColor(255, 255, 0);
myGLCD.setBackColor(0, 0, 0);
myGLCD.setFont(BigFont);
myGLCD.print("Hello, world", 20, 20);
for (int a=10; a<=90; a+=10)
{
myGLCD.print("Hello, world", 20, 20, a);
}
do {}while (1);
TFT touch screen 8

#include <UTFT.h>
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ITDB32S,38,39,40,41);
void setup()
{
 myGLCD.InitLCD();
 myGLCD.clrScr();
 myGLCD.setFont(BigFont);
}
void loop()
{
 myGLCD.print("Text rotation", 0, 0);
 myGLCD.setColor(0, 0, 255);
 myGLCD.print("0 degrees", 0, 16, 0);
 myGLCD.print("90 degrees", 319, 0, 90);
 myGLCD.print("180 degrees", 319, 239, 180);
 myGLCD.print("270 degrees", 0, 239, 270);
 myGLCD.setFont(SevenSegNumFont);
 myGLCD.setColor(0, 255, 0);
 myGLCD.print("45", 90, 100, 45);
 myGLCD.print("90", 200, 50, 90);
 myGLCD.print("180", 300, 200, 180);
 while (true) {};
}
 

[/nextpage]