Arduino UNO and ITDB02 2.8 Touch Screen

I have recently bought Arduino UNO and ITDB02 2.8 Touch Screen. There are 3 sample programs for ITDB02 2.8 Touch Screen Library : Google Code Archive - Long-term storage for Google Code Project Hosting. . I am able to run the first two but the touch screen application does not runs properly. It seems that the touch screen functionality is not working fine.

Also I am not able to see free or better graphics type apps using for ITDB02 2.8 Touch Screen (wrt Arduino UNO board). I am not sure either what type of graphics application we can develop using this hardware combo. Any reference to some graphics app would be helpful and also why the touch screen functionality is not working?

"functionality is not working fine." - what this is - blink?

ITDB02 lcd(0,1,2,3,4,5,6,7,19,18,17,16); <- to work?

void setup()
{
  lcd.Touchpin(15,10,14,9,8); <- what?

may be analog gluck blink on chip7781...7783 ? :frowning: 2.4 inch TFT touch LCD Screen Module For Arduino UNO R3 SD low price jocks - Displays - Arduino Forum

Below is the code - as per the code and app when I move my finger on the TFT the values of X,Y co-ordinates are not changing. BTW these are preliminary graphics - can we use these libs to create a push button with a text in it .

I am not sure what values to use / replace of for ITDB02 lcd(0,1,2,3,4,5,6,7,19,18,17,16); & lcd.Touchpin(15,10,14,9,8) API calls? How do we determine that?

#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(ITDB24D);
  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);
   } 
    
   }
}

2.software
i dont understand haw to work this is code

     lx=lcd.TouchGetX();//<-- calibrate resistors matric where?
     ly=lcd.TouchGetY();
     lcd.Drawdot(lx,ly);

my resistive matric have resistanse 1700/700 ??
i have aprocsimate variable "calibrate" 1 day!!!

#define TS_MINX 150//0.....
#define TS_MINY 120//0.....
#define TS_MAXX 920//900//320.....      //for calibrate analog resistans ~1500om/700om !!!
#define TS_MAXY 940//800//900//240.......//for calibrate analog resistans ~1500om/700om
...
    p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); // map !!!
    p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0);

see my work code

//20140208 art100  tft2.4" st7783 shield on arduino uno
// art100 write message 
//#include "st7783SD.h" // pins SD_SS-10 SD_DI-11(in) SD_DO-12(out) SD_SCK-13 no work
//#include "st7783TFT.h" //has not written
//#include "st7783TouchScreen.h" //has not written
#include "TFTLCD.h" // work
#include "TouchScreen.h" // bad but it works
//TouchScreen define
#define YP A1 //tftloop-YU pcbundertft-13 arduinoshieldLCD_WR!!! arduinouno-A1
#define XM A2 //tftloop-XR pcbundertft-14 arduinoshieldLCD_RS!!! arduinouno-A2
#define YM 7  //tftloop-XR pcbundertft-15 arduinoshieldLCD_D7 arduinouno-7
#define XP 6  //tftloop-XR pcbundertft-12 arduinoshieldLCD_D6 arduinouno-6
#define TS_MINX 150//0
#define TS_MINY 120//0
#define TS_MAXX 920//900//320      //for calibrate analog resistans ~1500om/700om
#define TS_MAXY 940//800//900//240 //for calibrate analog resistans ~1500om/700om
// For better pressure precision, we need to know the resistance// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
//TFT  define
#define LCD_RESET A4// 
#define LCD_CS A3
#define LCD_CD A2 //cmosbuffer-arduinoshieldLCD_RS!!! arduinouno-A2 this is jock :-?
#define LCD_WR A1 //cmosbuffer-arduinoshieldLCD_WR!!! arduinouno-A1 this is jock :-?
#define LCD_RD A0
// Color definitions
#define WHITE           0xFFFF
#define	BLACK           0x0000
#define	RED             0xF800
#define	BLUE            0x001F
#define	GREEN           0x07E0
#define YELLOW          0xFFE0 
TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
//SD define //has not written
#define bordur   5
#define pen      3
//---------------------------------------
void setup(void) {
  Serial.begin(9600);
  Serial.println("Paint");
  tft.reset();
  uint16_t identifier = tft.readRegister(0x0);
  tft.initDisplay(); 
  tft.fillScreen(RED);
}
#define MINPRESSURE 10    // analog calibrate
#define MAXPRESSURE 1000  // analog calibrate
//=======================================
void loop(){
  Point p = ts.getPoint(); // get analog point
  pinMode(XM, OUTPUT); //2 chip on one pins
  pinMode(YP, OUTPUT); //2 chip on one pins
  if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { // analog calibrate
    p.x = map(p.x, TS_MINX, TS_MAXX, 0, tft.width ()); // aprocsimate variable
    p.y = map(p.y, TS_MINY, TS_MAXY, 0, tft.height()); // aprocsimate variable
    
//    if (300< p.x) { // erase only on bordur  //no need have reset button
//      Serial.println("erase"); // test
//      tft.fillRect(0, 0, tft.width(), tft.height(), RED);// BLACK); //fill black
//    }
    
    // test
    Serial.print("getPoint x=");Serial.print(p.x);Serial.print(" y=");Serial.print(p.y);Serial.print(" PRESSURE=");Serial.print(p.z);  
    
    // paint
    if (((p.x)<tft.width()) && ((p.y)<tft.height())) { tft.fillRect(p.x,p.y,pen,pen,GREEN); } 
  }
}

download all 80mbyte old betta compiller https://drive.google.com/file/d/0B3hqYAvAOKllZ0M3d3E4REdiS2c/edit?usp=sharing
open
and see c:/arduinooldforst7781/library/TFTLCD7781/ TFTLCD.h !!!TouchScreen.h!!! /example tftsd very bed, tfttest work, tftpaint bed
see my work example

1.hardware
pins correct?

Sorry I am newbie in Arduino Development and don't understand much about "resistors matric". I have just plugged the ITDB02 2.8 Touch Screen shield to Arduino UNO and as below program is working fine I assume that my insertion is correct:

#include <ITDB02.h>

ITDB02 lcd(0,1,2,3,4,5,6,7,19,18,17,16); // 8 bit mode
//ITDB02 lcd(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,19,18,17,16);

void setup()
{
  lcd.Initial(ITDB32);
  lcd.CleanLCD();
}

void loop()
{
  int add=10;
  lcd.Setcolor(0xff00,0x00ff);
  lcd.Dispshowchar(add,10,'H');
  add+=7;
  lcd.Setcolor(0xaa00,0x00ff);
  lcd.Dispshowchar(add,10,'e');
  add+=7;
  lcd.Setcolor(0xaacc,0x00ff);
  lcd.Dispshowchar(add,10,'l');
  add+=7;
  lcd.Setcolor(0xffcc,0x00ff);
  lcd.Dispshowchar(add,10,'l');
  add+=7;
  lcd.Setcolor(0xadf0,0x00ff);
  lcd.Dispshowchar(add,10,'0');
  add+=7;
  lcd.Setcolor(0xcfea,0x00ff);
  lcd.Dispshowchar(add,10,' ');
  add+=7;
  lcd.Setcolor(0xaa00,0x00ff);
  lcd.Dispshowchar(add,10,'W');
  add+=7;
  lcd.Setcolor(0xdf30,0x00ff);
  lcd.Dispshowchar(add,10,'o');
  add+=7;
  lcd.Setcolor(0xc83f,0x00ff);
  lcd.Dispshowchar(add,10,'r');
  add+=7;
  lcd.Setcolor(0x087c,0x00ff);
  lcd.Dispshowchar(add,10,'l');
  add+=7;
  lcd.Setcolor(0xcf23,0x00ff);
  lcd.Dispshowchar(add,10,'d');
  add+=7;
  lcd.Setcolor(0x35cc,0x00ff);
  lcd.Dispshowchar(add,10,'!');

  lcd.Setcolor(0x00,0xffff);
  lcd.Dispshowstr(80,300,"iteadstudio.com");
}

I see output as "Hello World!". In case of Touch screen app I see below output :

Touch Test Demo






X 0000 Y 0000 iteadstudio.com
  1. TFT+touchscreen+arduino - all newcomers :-?
    2.good shield has not disintegrated :-0
    3.good code is not yet :open_mouth:
    4.trends have not tested well :frowning:
    What's the problem you?

see my work code

my resistive 700...1700 Om
x and y get 10000 0
need finction map
i get right x and y

i no now rigth or not pins we
i tested pins rigth only on my TFTshield on my chip st7781

I belorus.
I understund on english write?

//20140207 art100  tft2.4" st7783 shield on arduino uno
// art100 write message 
//#include "st7783SD.h" // pins SD_SS-10 SD_DI-11(in) SD_DO-12(out) SD_SCK-13 no work
//#include "st7783TFTLCD.h"
//#include "st7783TouchScreen.h"
#include "TFTLCD.h"
#include "TouchScreen.h"
//TouchScreen
#define YP A1 //tftloop-YU pcbundertft-13 arduinoshieldLCD_WR!!! arduinouno-A1
#define XM A2 //tftloop-XR pcbundertft-14 arduinoshieldLCD_RS!!! arduinouno-A2
#define YM 7  //tftloop-XR pcbundertft-15 arduinoshieldLCD_D7 arduinouno-7
#define XP 6  //tftloop-XR pcbundertft-12 arduinoshieldLCD_D6 arduinouno-6
#define TS_MINX 150//0
#define TS_MINY 120//0
#define TS_MAXX 920//900//320      //for calibrate analog resistans ~1500om/700om
#define TS_MAXY 940//800//900//240 //for calibrate analog resistans ~1500om/700om
// For better pressure precision, we need to know the resistance// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
//TFT
#define LCD_RESET A4// 
#define LCD_CS A3
#define LCD_CD A2 //cmosbuffer-arduinoshieldLCD_RS!!! arduinouno-A2
#define LCD_WR A1 //cmosbuffer-arduinoshieldLCD_WR!!! arduinouno-A1
#define LCD_RD A0
// Color definitions
#define WHITE           0xFFFF
#define	BLACK           0x0000
#define	RED             0xF800
#define	BLUE            0x001F
#define	GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0 
TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);

#define BOXSIZE   50
#define PENRADIUS 3//10
int oldcolor, currentcolor;

void setup(void) {
  Serial.begin(9600);
  Serial.println("Paint");
//  pinMode(XM, OUTPUT);
//  pinMode(YP, OUTPUT);  
  tft.reset();
  uint16_t identifier = tft.readRegister(0x0);
  tft.initDisplay(); 
  tft.fillScreen(BLACK);
//  void drawRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t color);
//  void fillRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t color);
tft.fillRect(        0,       0, BOXSIZE, BOXSIZE, RED);    // tft.fillRect(        0, 320-BOXSIZE, BOXSIZE, 320, RED);
tft.fillRect(BOXSIZE  ,       0, BOXSIZE, BOXSIZE, BLUE);   // tft.fillRect(BOXSIZE*1, 320-BOXSIZE, BOXSIZE, 320, BLUE);
tft.fillRect(BOXSIZE*2,       0, BOXSIZE, BOXSIZE, GREEN);  // tft.fillRect(BOXSIZE*2, 320-BOXSIZE, BOXSIZE, 320, GREEN);
tft.fillRect(BOXSIZE*3,       0, BOXSIZE, BOXSIZE, BLACK);  //WHITE);  // tft.fillRect(BOXSIZE*3, 320-BOXSIZE, BOXSIZE, 320, WHITE);
tft.fillRect(BOXSIZE*4,       0, BOXSIZE, BOXSIZE, BLACK);  // tft.fillRect(BOXSIZE*4, 320-BOXSIZE, BOXSIZE, 320, BLACK);
tft.fillRect(BOXSIZE*5,       0, BOXSIZE, BOXSIZE, BLACK);  //YELLOW); // tft.fillRect(BOXSIZE*5, 320-BOXSIZE, BOXSIZE, 320, YELLOW);
  pinMode(13, OUTPUT);

}
#define MINPRESSURE 10
#define MAXPRESSURE 1000

void loop()
{
//  tft.fillCircle( 300,200,10,RED);
  digitalWrite(13, HIGH);
  Point p = ts.getPoint();
  digitalWrite(13, LOW);
  pinMode(XM, OUTPUT);
  pinMode(YP, OUTPUT);
 
  if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { // we have some minimum pressure we consider 'valid'  // pressure of 0 means no pressing!
    // turn from 0->1023 to tft.width
    p.x = map(p.x, TS_MINX, TS_MAXX, 0, tft.width());
    p.y = map(p.y, TS_MINY, TS_MAXY, 0, tft.height());

    if (p.x<BOXSIZE && (BOXSIZE*3)<p.y<BOXSIZE) {// press the bottom of the screen to erase 
      Serial.println("erase");
      tft.fillRect(0, 0, tft.width(), tft.height(), BLACK);
    }

Serial.print("getPoint x=");Serial.print(p.x);Serial.print(" y=");Serial.print(p.y);Serial.print(" PRESSURE=");Serial.print(p.z);      

    
 
//    if (p.y < BOXSIZE) {
       oldcolor = currentcolor;
//
       if      (0<p.x<BOXSIZE &&         0<p.y<BOXSIZE  ) { currentcolor = RED;     tft.drawRect( 0,       0,  BOXSIZE, BOXSIZE, RED);   } 
       else if (0<p.x<BOXSIZE && BOXSIZE  <p.y<BOXSIZE*2) { currentcolor = BLUE;    tft.drawRect( 0,BOXSIZE ,  BOXSIZE, BOXSIZE, BLUE);  }
       else if (0<p.x<BOXSIZE && BOXSIZE*2<p.y<BOXSIZE*3) { currentcolor = GREEN;   tft.drawRect( 0,BOXSIZE*2, BOXSIZE, BOXSIZE, GREEN); }
       else if (0<p.x<BOXSIZE && BOXSIZE*3<p.y<BOXSIZE*4) {                         tft.drawRect( 0,BOXSIZE*3, BOXSIZE, BOXSIZE, BLACK); }
       else if (0<p.x<BOXSIZE && BOXSIZE*4<p.y<BOXSIZE*5) {                         tft.drawRect( 0,BOXSIZE*4, BOXSIZE, BOXSIZE, BLACK); }
Serial.print(" currentcolor=");Serial.println(currentcolor);       
//       if (oldcolor != currentcolor) {
//          if (oldcolor == RED   ) tft.fillRect(        0, 0, BOXSIZE, BOXSIZE, WHITE);// RED);
//          if (oldcolor == BLUE  ) tft.fillRect(BOXSIZE,   0, BOXSIZE, BOXSIZE, WHITE);// BLUE);
//          if (oldcolor == GREEN ) tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, WHITE);// GREEN);
//          if (oldcolor == WHITE ) tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, WHITE);//  
//          if (oldcolor == BLACK ) tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, WHITE);// BLACK);
//          if (oldcolor == YELLOW) tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, WHITE);// YELLOW);
//       }
//       
//    }

//    if (((p.y-PENRADIUS) > BOXSIZE) && ((p.y+PENRADIUS) < tft.height())) {      tft.fillCircle(240-p.x, 320-p.y, PENRADIUS, currentcolor);    } BRED
//    if (((p.y-PENRADIUS) > BOXSIZE) && ((p.y+PENRADIUS) < tft.height())) { tft.fillCircle(p.x,p.y,PENRADIUS,currentcolor); }
//    if (((p.x+PENRADIUS)<tft.width()) && ((p.y+PENRADIUS)<tft.height())) { tft.fillCircle( p.x,p.y,PENRADIUS,currentcolor ); }
//    if (((p.x+PENRADIUS)<tft.width()) && ((p.y+PENRADIUS)<tft.height())) {tft.fillRect(10, 10, 10, 10, RED);}
//    if ( ((p.x)<tft.width() ) && ( (p.y) < tft.height() ) ) { tft.fillRect(p.x,p.y,10,10,RED); }    
      if (((p.x)<tft.width()) && ((p.y)<tft.height())) { tft.fillRect(p.x,p.y,PENRADIUS,PENRADIUS,RED); } 

  }
}

TouchScreen.h and cpp and tftpaint20140308173000ok.pde
my problem this is blink on paint
I no understand you problem whith touch?
see video

tft-st7783-helloworld.jpg

tftpaint20140308120000ok.pde (5.12 KB)

TFTLCD7783.rar (196 KB)

[code]
...output...

all to work

Touch

work obviously only my only on my matrix resistive
I do not like my code but it works
[/code]

Buenas, soy novato con la pantalla tactil tft 2.4 para arduino uno, quesiera saber una guia para colocarla a funcionar, URGENTE