Hello guys,
I've purchased Arduino Uno and explored it for quiet a while. Now recently I purchased a ITDB02-2.8 TFT LCD Module from ITED Studio and ITDB02 Arduino shield v2.0 to connect it with my Uno board. I downloaded ITDB02 library and tried all 3 examples. Everything is working fine except the touch function. It seems that it is not detecting touch at all. By the way, I do not have stylus pen so I'm using good old finger! I'm uploading the code I've used.
#include <ITDB02.h>
ITDB02 lcd(0,1,2,3,4,5,6,7,19,18,17,16);
void setup()
{
lcd.Touchpin(15,10,14,9,8);
lcd.Initial();
lcd.CleanLCD();
lcd.TouchInitial();
}
void loop()
{
char ASCII[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
char tp;
unsigned int lx,ly;
lcd.Setcolor(0,0xffff);
lcd.Dispshowstr(5,5,"Touch Test Demo");
lcd.Dispshowstr(130,300,"iteadstudio.com");
for(;;)
{
if(lcd.TouchIRQ()==0)
{
lcd.TouchGetaddress();
lcd.Dispshowchar(3,300,'X');
lcd.Dispshowchar(10,300,' ');
tp=ASCII[(lcd.TP_X>>24)&0x0F];
lcd.Dispshowchar(17,300,tp);
tp=ASCII[(lcd.TP_X>>16)&0x0F];
lcd.Dispshowchar(24,300,tp);
tp=ASCII[(lcd.TP_X>>8)&0x0F];
lcd.Dispshowchar(31,300,tp);
tp=ASCII[(lcd.TP_X&0x0F)];
lcd.Dispshowchar(37,300,tp);
lcd.Dispshowchar(53,300,'Y');
lcd.Dispshowchar(60,300,' ');
tp=ASCII[(lcd.TP_Y>>24)&0x0F];
lcd.Dispshowchar(67,300,tp);
tp=ASCII[(lcd.TP_Y>>16)&0x0F];
lcd.Dispshowchar(74,300,tp);
tp=ASCII[(lcd.TP_Y>>8)&0x0F];
lcd.Dispshowchar(81,300,tp);
tp=ASCII[(lcd.TP_Y&0x0F)];
lcd.Dispshowchar(88,300,tp);
lx=lcd.TouchGetX();
ly=lcd.TouchGetY();
lcd.Drawdot(lx,ly);
}
}
}
All the texts are displayed fine and the x and y co-ordinate values are showing all zeroes even if I touch the screen anywhere!!! Is the code wrong or is there any kind of initialization issues I'm missing since I'm using the shield to connect it with my Uno? Thanks in advance.