[RÉSOLUT] Calibrer un ITDB02 5.0

Bonjour a tous
je viens de recevoir un ecrant tft 5.0" de chez iteadstudio le plus grand de la gamme
cela fait 2 jour complet que je me casse les dents a essayer de calibrer le tactile
j'ai essayer le code de basse que l'on trouve ici:

mais il ne me semble pas marcher

j'ai essayer la fonction de calibration fourni avec la librairie itdb_touch en esseyant ensuite d'adapter le code a mon ecrant comme suit

ITDB02_Touch_Calibration (C)2010 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program can be used to calibrate the touchscreen
// of the ITDB02 modules.
// This program requires the ITDB02_Graph library (8bit mode)
// or ITDB02_Graph16 (16bit mode).
//
// It is assumed that the ITDB02 module is connected to a
// ITDB02 Shield, a ITDB02 Mega Shield or that you know how 
// to change the pin numbers in the setup.
//
// Instructions will be given on the display.
//

// Remember to change the next line if you are using as 16bit module!
#include <UTFT.h>
#include <ITDB02_Touch.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];



// Uncomment the next two lines for the ITDB02 Mega Shield
UTFT myGLCD(ITDB50,38,39,40,41);   // Remember to add ASPECT_16x9 if you are using an ITDB02-3.2WC!
ITDB02_Touch  myTouch(6,5,4,3,2);

int cx, cy;
int rx[10], ry[10];
float px, py;
int ox, oy;

void setup()
{
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);

  myTouch.InitTouch();
  myTouch.setPrecision(PREC_LOW);
}

void drawCrossHair(int x, int y)
{
  myGLCD.drawRect(x-10, y-10, x+10, y+10);
  myGLCD.drawLine(x-5, y, x+5, y);
  myGLCD.drawLine(x, y-5, x, y+5);
}

void readCoordinates()
{
  int iter = 2000;
  int cnt = 0;
  unsigned long tx=0;
  unsigned long ty=0;
  boolean OK = false;
  
  while (OK == false)
  {
    while (myTouch.dataAvailable() == false) {}
    while ((myTouch.dataAvailable() == true) && (cnt<iter))
    {
      myTouch.read();
      tx += myTouch.TP_X;
      ty += myTouch.TP_Y;
      cnt++;
    }
    if (cnt>=iter)
    {
      OK = true;
    }
    else
    {
      tx = 0;
      ty = 0;
      cnt = 0;
    }
  }

  cx = tx / iter;
  cy = ty / iter;

}

void calibrate(int x, int y, int i)
{
  myGLCD.setColor(255, 255, 255);
  drawCrossHair(x,y);
  readCoordinates();
  myGLCD.setColor(80, 80, 80);
  drawCrossHair(x,y);
  
  rx[i]=cx;
  ry[i]=cy;
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
  }
}

void waitForTouch()
{
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
  }
  while (myTouch.dataAvailable() == false) {}
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
  }
}

void startup()
{
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, 239, 13);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.drawLine(0, 14, 239, 14);
  myGLCD.print("ITDB02 TOUCH CALIBRATION", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);
  
  myGLCD.print("INSTRUCTIONS", CENTER, 30);
  myGLCD.print("Use a stylus or something", LEFT, 50);
  myGLCD.print("similar to touch as close to", LEFT, 62);
  myGLCD.print("the center of the highlighted", LEFT, 74);
  myGLCD.print("crosshair as possible. Keep as", LEFT, 86);
  myGLCD.print("still as possible and keep", LEFT, 98);
  myGLCD.print("holding until the highlight is", LEFT, 110);
  myGLCD.print("removed. Repeat for all", LEFT, 122);
  myGLCD.print("crosshairs in sequence.", LEFT, 134);
  myGLCD.print("Further instructions will be", LEFT, 158);
  myGLCD.print("displayed when the calibration", LEFT, 170);
  myGLCD.print("is complete.", LEFT, 182);
  myGLCD.print("Do NOT use your finger as a", LEFT, 206);
  myGLCD.print("calibration stylus or the", LEFT, 218);
  myGLCD.print("result WILL BE very imprecise.", LEFT, 230);
  myGLCD.print("Touch screen to continue", CENTER, 305);

  waitForTouch();
  myGLCD.clrScr();
}

void done()
{
  myGLCD.clrScr();
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, 239, 13);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.drawLine(0, 14, 239, 14);
  myGLCD.print("ITDB02 TOUCH CALIBRATION", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);
  
  myGLCD.print("CALIBRATION COMPLETE", CENTER, 30);
  myGLCD.print("To use the new calibration", LEFT, 50);
  myGLCD.print("settings you must edit the", LEFT, 62);
  myGLCD.setColor(160, 160, 255);
  myGLCD.print("ITDB02_Touch.cpp", LEFT, 74);
  myGLCD.setColor(255, 255, 255);
  myGLCD.print("file and", 136, 74);
  myGLCD.print("change the following values.", LEFT, 86);
  myGLCD.print("The values are located right", LEFT, 98);
  myGLCD.print("below the opening comment in", LEFT, 110);
  myGLCD.print("the file.", LEFT, 122);
  myGLCD.print("PixSizeX", LEFT, 158);
  myGLCD.print("PixOffsX", LEFT, 170);
  myGLCD.print("PixSizeY", LEFT, 182);
  myGLCD.print("PixOffsY", LEFT, 194);
  myGLCD.print("Connected module:", LEFT, 250);
  myGLCD.drawLine(0, 155, 239, 155);
  myGLCD.drawLine(0, 209, 239, 209);

  myGLCD.printNumF(px, 2, 100, 158);
  myGLCD.printNumI(ox, 100, 170);
  myGLCD.printNumF(py, 2, 100, 182);
  myGLCD.printNumI(oy, 100, 194);
  if (px>=0)
    myGLCD.print("2.4\"", 144, 250);
  else
  {
    if (py>=0)
    {
      myGLCD.print("3.2\"", 144, 250);
      myGLCD.print("Negative numbers for PixSizeX", LEFT, 270);
      myGLCD.print("is expected :)", LEFT, 282);
    }
    else
    {
      myGLCD.print("3.2\" Wide", 144, 250);
      myGLCD.print("Negative numbers for PixSizeX", LEFT, 270);
      myGLCD.print("and PixSizeY are expected :)", LEFT, 282);
    }
  }
}

void loop()
{
  startup();
  
  myGLCD.setColor(80, 80, 80);
  
  
 /* drawCrossHair(10,10);
   drawCrossHair(10,400);
   drawCrossHair(10,789);
   drawCrossHair(240,10);
   drawCrossHair(240,400);
   drawCrossHair(240,789);
   drawCrossHair(469,10);
   drawCrossHair(469,400);
   drawCrossHair(469,789);*/
   
  /*calibrate(10,10,0);
   calibrate(10,400,1);
   calibrate(10,789,2);
   calibrate(240,10,3);
   calibrate(240,400,4);
   calibrate(240,789,5);
   calibrate(469,10,6);
   calibrate(469,400,7);
   calibrate(469,789,8);*/
  
  
  drawCrossHair(10,10);
  drawCrossHair(10,240);
  drawCrossHair(10,469);
  drawCrossHair(400,10);
  drawCrossHair(400,240);
  drawCrossHair(400,469);
  drawCrossHair(789,10);
  drawCrossHair(789,240);
  drawCrossHair(789,469);
  
  
   calibrate(10,10,0);
   calibrate(10,240,1);
   calibrate(10,469,2);
   calibrate(400,10,3);
   calibrate(400,240,4);
   calibrate(400,469,5);
   calibrate(789,10,6);
   calibrate(789,240,7);
   calibrate(789,469,8);
  
 /* calibrate(10, 10, 0);
  calibrate(10, 160, 1);
  calibrate(10, 309, 2);
  calibrate(120, 10, 3);
  calibrate(120, 160, 4);
  calibrate(120, 309, 5);
  calibrate(229, 10, 6);
  calibrate(229, 160, 7);
  calibrate(229, 309, 8);*/
  
  px = ((float(rx[0]+rx[1]+rx[2])/3)-(float(rx[6]+rx[7]+rx[8])/3))/460;//x final -xdepar c'est Px=PixSizeX
  if (px>=0)
    ox = (((rx[6]+rx[7]+rx[8])/3))-(px*10);// ox=PixOffsX
  else
    ox = (((rx[0]+rx[1]+rx[2])/3))+(px*10);

  py = ((float(ry[0]+ry[3]+ry[6])/3)-(float(ry[2]+ry[5]+ry[8])/3))/780;//yfinal -ydepart
  if (py>=0)
    oy = (((ry[2]+ry[5]+ry[8])/3))-(py*10);
  else
    oy = (((ry[0]+ry[3]+ry[6])/3))+(py*10);
    

  done();
  while(true) {}
}

Mais je n'arrive pas a obtenire les bonne valeur pour ces variable

#define PixSizeX	-4.69
#define PixOffsX	615
#define PixSizeY	-1.22
#define PixOffsY	265

quelqu'un pourait t'il m'aider , avant que je crakkkkk merci ! =(

Bon s'a y'est ça marche mais il a fallu que je me prenne la tête ]:smiley:
alors pour cela j'ai
trafiqué le code fournie par le constructeur comme suit :

/**********************************************
Pay an attention!

This code is designed for Arduino Mega board.
modifier par Helodermakris le 28_11_12
**********************************************/
#include <UTFT.h>
extern uint8_t SmallFont[];
/**********************************************

Define zone
**********************************************/
#define RS 38
#define WR 39
#define CS 40
#define RST 41
#define T_CLK 6
#define T_CS 5
#define T_DIN 4
#define T_DOUT 3
#define T_IRQ 2
#define PREC_TOUCH_CONST 10
#define PixSizeX	4.81//4.8
#define PixOffsX	140//20
#define PixSizeY	7.80//7.8
#define PixOffsY	230//20


UTFT myGLCD(ITDB50,38,39,40,41);  
/**********************************************
Val Zone
**********************************************/
int TP_X,TP_Y;

void Touch_Init(void)
{
	pinMode(T_CLK,  OUTPUT);
    pinMode(T_CS,   OUTPUT);
    pinMode(T_DIN,  OUTPUT);
    pinMode(T_DOUT, INPUT);
    pinMode(T_IRQ,  INPUT);

	digitalWrite(T_CS,  HIGH);
	digitalWrite(T_CLK, HIGH);
	digitalWrite(T_DIN, HIGH);
	digitalWrite(T_CLK, HIGH);
}

void Touch_WriteData(unsigned char data)
{
	unsigned char temp;
	unsigned char nop;
	unsigned char count;

	temp=data;
	digitalWrite(T_CLK,LOW);

	for(count=0; count<8; count++)
	{
		if(temp & 0x80)
			digitalWrite(T_DIN, HIGH);
		else
			digitalWrite(T_DIN, LOW);
		temp = temp << 1; 
		digitalWrite(T_CLK, LOW);                
		nop++;
		digitalWrite(T_CLK, HIGH);
		nop++;
	}
}

unsigned int Touch_ReadData()
{
	unsigned char nop;
	unsigned int data = 0;
	unsigned char count;
	for(count=0; count<12; count++)
	{
		data <<= 1;
		digitalWrite(T_CLK, HIGH);               
		nop++;
		digitalWrite(T_CLK, LOW);
		nop++;
		if (digitalRead(T_DOUT))
			data++;
	}
	return(data);
}
void Touch_Read()
{
	unsigned long tx=0;
	unsigned long ty=0;

	digitalWrite(T_CS,LOW);                    

	for (int i=0; i<PREC_TOUCH_CONST; i++)
	{
		Touch_WriteData(0x90);        
		digitalWrite(T_CLK,HIGH);
		digitalWrite(T_CLK,LOW); 
		ty+=Touch_ReadData();

		Touch_WriteData(0xD0);      
		digitalWrite(T_CLK,HIGH);
		digitalWrite(T_CLK,LOW);
		tx+=Touch_ReadData();
	}

	digitalWrite(T_CS,HIGH);

	TP_X=tx/PREC_TOUCH_CONST;
	TP_Y=ty/PREC_TOUCH_CONST;
}

char Touch_DataAvailable()
{
  char avail;
  avail = !digitalRead(T_IRQ);
  return avail;
}

int Touch_GetX()
{
	int value;
	value = ((TP_X-PixOffsX)/PixSizeX);
	if (value < 0)
		value = 0;
	return value;
}
int Touch_GetY()
{
	int value;
	value = ((TP_Y-PixOffsY)/PixSizeY);
	if (value < 0)
		value = 0;
	return value;
}


void setup()
{
   myGLCD.InitLCD(LANDSCAPE);
  //myGLCD.clrScr(255,255,255);
  myGLCD.setFont(SmallFont);
  Touch_Init();
   myGLCD.fillScr(255,255,255);
  
}

void loop()
{
  unsigned int  i,j;
   	while(Touch_DataAvailable() == 1)
	{
		Touch_Read();
		i = Touch_GetX();
		j = Touch_GetY();
                myGLCD.setColor(0, 0, 0);
		myGLCD.drawPixel (Touch_GetX(), Touch_GetY());


	}
 
}

avec les variable suivante(dont j'ai enfin compris ce quelle representer):

#define PixSizeX	4.81//corespont a l'inverse d'un gain
#define PixOffsX	140//corespond a un offset sur X
#define PixSizeY	7.80//corespont a l'inverse d'un gain
#define PixOffsY	230//corespond a un offset sur Y

j'ai proceder par tatonement en jouant sur les variable aprés avoir tracer sur mon ecrant une croix representant le centre!
j'ai encor quelque pixel ignorer en bordure du cadre de l'ecran (je dirai entre 5et 10 pix tout le tour) mais ça me perme de comencer a utiliser!

pour ceux qui veul voila le code modifier de l'exemple de bouton teste :

//modifier par Helodermakris le 28_11_12
// ITDB02_Touch_ButtonTest (C)2010 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a quick demo of how create and use buttons.
//
// This program requires the ITDB02_Graph library (8bit mode)
// or ITDB02_Graph16 (16bit mode).
//
// It is assumed that the ITDB02 module is connected to a
// ITDB02 Shield, a ITDB02 Mega Shield or that you know how 
// to change the pin numbers in the setup.
//

// Remember to change the next line if you are using as 16bit module!
#include <UTFT.h>
#include <ITDB02_Touch.h>

// Declare which fonts we will be using
extern uint8_t BigFont[];

/**********************************************
Pay an attention!

This code is designed for Arduino Mega board.

**********************************************/
#include <UTFT.h>
extern uint8_t SmallFont[];
/**********************************************

Define zone
**********************************************/
#define RS 38
#define WR 39
#define CS 40
#define RST 41
#define T_CLK 6
#define T_CS 5
#define T_DIN 4
#define T_DOUT 3
#define T_IRQ 2
#define PREC_TOUCH_CONST 10
#define PixSizeX	4.81//4.8
#define PixOffsX	140//20
#define PixSizeY	7.80//7.8
#define PixOffsY	230//20


UTFT myGLCD(ITDB50,38,39,40,41);  
/**********************************************
Val Zone
**********************************************/
int TP_X,TP_Y;

void Touch_Init(void)
{
	pinMode(T_CLK,  OUTPUT);
    pinMode(T_CS,   OUTPUT);
    pinMode(T_DIN,  OUTPUT);
    pinMode(T_DOUT, INPUT);
    pinMode(T_IRQ,  INPUT);

	digitalWrite(T_CS,  HIGH);
	digitalWrite(T_CLK, HIGH);
	digitalWrite(T_DIN, HIGH);
	digitalWrite(T_CLK, HIGH);
}

void Touch_WriteData(unsigned char data)
{
	unsigned char temp;
	unsigned char nop;
	unsigned char count;

	temp=data;
	digitalWrite(T_CLK,LOW);

	for(count=0; count<8; count++)
	{
		if(temp & 0x80)
			digitalWrite(T_DIN, HIGH);
		else
			digitalWrite(T_DIN, LOW);
		temp = temp << 1; 
		digitalWrite(T_CLK, LOW);                
		nop++;
		digitalWrite(T_CLK, HIGH);
		nop++;
	}
}

unsigned int Touch_ReadData()
{
	unsigned char nop;
	unsigned int data = 0;
	unsigned char count;
	for(count=0; count<12; count++)
	{
		data <<= 1;
		digitalWrite(T_CLK, HIGH);               
		nop++;
		digitalWrite(T_CLK, LOW);
		nop++;
		if (digitalRead(T_DOUT))
			data++;
	}
	return(data);
}
void Touch_Read()
{
	unsigned long tx=0;
	unsigned long ty=0;

	digitalWrite(T_CS,LOW);                    

	for (int i=0; i<PREC_TOUCH_CONST; i++)
	{
		Touch_WriteData(0x90);        
		digitalWrite(T_CLK,HIGH);
		digitalWrite(T_CLK,LOW); 
		ty+=Touch_ReadData();

		Touch_WriteData(0xD0);      
		digitalWrite(T_CLK,HIGH);
		digitalWrite(T_CLK,LOW);
		tx+=Touch_ReadData();
	}

	digitalWrite(T_CS,HIGH);

	TP_X=tx/PREC_TOUCH_CONST;
	TP_Y=ty/PREC_TOUCH_CONST;
}

char Touch_DataAvailable()
{
  char avail;
  avail = !digitalRead(T_IRQ);
  return avail;
}

int Touch_GetX()
{
	int value;
	value = ((TP_X-PixOffsX)/PixSizeX);
	if (value < 0)
		value = 0;
	return value;
}
int Touch_GetY()
{
	int value;
	value = ((TP_Y-PixOffsY)/PixSizeY);
	if (value < 0)
		value = 0;
	return value;
}

// Uncomment the next two lines for the ITDB02 Mega Shield
//UTFT        myGLCD(ITDB50,38,39,40,41);   // Remember to add ASPECT_16x9 if you are using an ITDB02-3.2WC!
//ITDB02_Touch  myTouch(6,5,4,3,2);

int x, y;
char stCurrent[20]="";
int stCurrentLen=0;
char stLast[20]="";

void setup()
{
// Initial setup
  myGLCD.InitLCD(LANDSCAPE);
  myGLCD.clrScr();

 Touch_Init();

  myGLCD.setFont(BigFont);
  myGLCD.setBackColor(0, 0, 255);
  
// Draw the upper row of buttons
  for (x=0; x<5; x++)
  {
    myGLCD.setColor(0, 0, 255);
    myGLCD.fillRoundRect (10+(x*60), 10, 60+(x*60), 60);
    myGLCD.setColor(255, 255, 255);
    myGLCD.drawRoundRect (10+(x*60), 10, 60+(x*60), 60);
    myGLCD.printNumI(x+1, 27+(x*60), 27);
  }
// Draw the center row of buttons
  for (x=0; x<5; x++)
  {
    myGLCD.setColor(0, 0, 255);
    myGLCD.fillRoundRect (10+(x*60), 70, 60+(x*60), 120);
    myGLCD.setColor(255, 255, 255);
    myGLCD.drawRoundRect (10+(x*60), 70, 60+(x*60), 120);
    if (x<4)
      myGLCD.printNumI(x+6, 27+(x*60), 87);
  }
  myGLCD.print("0", 267, 87);
// Draw the lower row of buttons
  myGLCD.setColor(0, 0, 255);
  myGLCD.fillRoundRect (10, 130, 150, 180);
  myGLCD.setColor(255, 255, 255);
  myGLCD.drawRoundRect (10, 130, 150, 180);
  myGLCD.print("Clear", 40, 147);
  myGLCD.setColor(0, 0, 255);
  myGLCD.fillRoundRect (160, 130, 300, 180);
  myGLCD.setColor(255, 255, 255);
  myGLCD.drawRoundRect (160, 130, 300, 180);
  myGLCD.print("Enter", 190, 147);
  myGLCD.setBackColor (0, 0, 0);
}

void updateStr(int val)
{
  if (stCurrentLen<20)
  {
    stCurrent[stCurrentLen]=val;
    stCurrent[stCurrentLen+1]='\0';
    stCurrentLen++;
    myGLCD.setColor(0, 255, 0);
    myGLCD.print(stCurrent, LEFT, 224);
  }
  else
  {
    myGLCD.setColor(255, 0, 0);
    myGLCD.print("BUFFER FULL!", CENTER, 192);
    delay(500);
    myGLCD.print("            ", CENTER, 192);
    delay(500);
    myGLCD.print("BUFFER FULL!", CENTER, 192);
    delay(500);
    myGLCD.print("            ", CENTER, 192);
    myGLCD.setColor(0, 255, 0);
  }
}

// Draw a red frame while a button is touched
void waitForIt(int x1, int y1, int x2, int y2)
{
  myGLCD.setColor(255, 0, 0);
  myGLCD.drawRoundRect (x1, y1, x2, y2);
  while (Touch_DataAvailable())
    Touch_Read();
  myGLCD.setColor(255, 255, 255);
  myGLCD.drawRoundRect (x1, y1, x2, y2);
}

void loop()
{
  while (true)
  {
    if (Touch_DataAvailable())
    {
      Touch_Read();
      x=Touch_GetX();
      y=Touch_GetY();
      
      if ((y>=10) && (y<=60))  // Upper row
      {
        if ((x>=10) && (x<=60))  // Button: 1
        {
          waitForIt(10, 10, 60, 60);
          updateStr('1');
        }
        if ((x>=70) && (x<=120))  // Button: 2
        {
          waitForIt(70, 10, 120, 60);
          updateStr('2');
        }
        if ((x>=130) && (x<=180))  // Button: 3
        {
          waitForIt(130, 10, 180, 60);
          updateStr('3');
        }
        if ((x>=190) && (x<=240))  // Button: 4
        {
          waitForIt(190, 10, 240, 60);
          updateStr('4');
        }
        if ((x>=250) && (x<=300))  // Button: 5
        {
          waitForIt(250, 10, 300, 60);
          updateStr('5');
        }
      }

      if ((y>=70) && (y<=120))  // Center row
      {
        if ((x>=10) && (x<=60))  // Button: 6
        {
          waitForIt(10, 70, 60, 120);
          updateStr('6');
        }
        if ((x>=70) && (x<=120))  // Button: 7
        {
          waitForIt(70, 70, 120, 120);
          updateStr('7');
        }
        if ((x>=130) && (x<=180))  // Button: 8
        {
          waitForIt(130, 70, 180, 120);
          updateStr('8');
        }
        if ((x>=190) && (x<=240))  // Button: 9
        {
          waitForIt(190, 70, 240, 120);
          updateStr('9');
        }
        if ((x>=250) && (x<=300))  // Button: 0
        {
          waitForIt(250, 70, 300, 120);
          updateStr('0');
        }
      }

      if ((y>=130) && (y<=180))  // Upper row
      {
        if ((x>=10) && (x<=150))  // Button: Clear
        {
          waitForIt(10, 130, 150, 180);
          stCurrent[0]='\0';
          stCurrentLen=0;
          myGLCD.setColor(0, 0, 0);
          myGLCD.fillRect(0, 224, 319, 239);
        }
        if ((x>=160) && (x<=300))  // Button: Enter
        {
          waitForIt(160, 130, 300, 180);
          if (stCurrentLen>0)
          {
            for (x=0; x<stCurrentLen+1; x++)
            {
              stLast[x]=stCurrent[x];
            }
            stCurrent[0]='\0';
            stCurrentLen=0;
            myGLCD.setColor(0, 0, 0);
            myGLCD.fillRect(0, 208, 319, 239);
            myGLCD.setColor(0, 255, 0);
            myGLCD.print(stLast, LEFT, 208);
          }
          else
          {
            myGLCD.setColor(255, 0, 0);
            myGLCD.print("BUFFER EMPTY", CENTER, 192);
            delay(500);
            myGLCD.print("            ", CENTER, 192);
            delay(500);
            myGLCD.print("BUFFER EMPTY", CENTER, 192);
            delay(500);
            myGLCD.print("            ", CENTER, 192);
            myGLCD.setColor(0, 255, 0);
          }
        }
      }
    }
  }
}

si vous avez mieux je suis preneur , puisque mes variable ne fonctione pas avec la librairie ITDB_Touch.h