utouch ssd1963 5 inch problem

ive got this sketch

// UTouch_QuickDraw (C)2010-2012 Henning Karlsen
// web: Electronics - Henning Karlsen
//
// This program is a quick demo of how to use the library.
//
// This program requires the UTFT library.
//
// It is assumed that the display module is connected to an
// appropriate shield or that you know how to change the pin
// numbers in the setup.
//

#include <UTFT.h>
#include <UTouch.h>

// Uncomment the next two lines for the Arduino 2009/UNO
//UTFT myGLCD(ITDB24D,19,18,17,16); // Remember to change the model parameter to suit your display module!
//UTouch myTouch(15,10,14,9,8);

// Uncomment the next two lines for the Arduino Mega
UTFT myGLCD(SSD1963_800, 38,39,40,41); // Remember to change the model parameter to suit your display module!
UTouch myTouch(6,5,4,3,2);

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

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

void loop()
{
long x, y;

while (myTouch.dataAvailable() == true)
{
myTouch.read();
x = myTouch.getX();
y = myTouch.getY();
if ((x!=-1) and (y!=-1))
{
myGLCD.drawPixel (x, y);
}
}
}

and this for calibration

// UTouch_Calibration (C)2012 Henning Karlsen

#include <UTFT.h>
#include <UTouch.h>

// Define the orientation of the touch screen. Further
// information can be found in the instructions.
#define TOUCH_ORIENTATION PORTRAIT

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

// Uncomment the next two lines for the Arduino Mega
UTFT myGLCD(SSD1963_800,38,39,40,41); // Remember to change the model parameter to suit your display module!
UTouch myTouch(6,5,4,3,2);

// ************************************
// DO NOT EDIT ANYTHING BELOW THIS LINE
// ************************************
uint32_t cx, cy;
uint32_t rx[10], ry[10];
uint32_t clx, crx, cty, cby;
float px, py;
int dispx, dispy, text_y_center;
uint32_t calx, caly, cals;
char buf[13];

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

myTouch.InitTouch(TOUCH_ORIENTATION);
myTouch.setPrecision(PREC_LOW);
dispx=myGLCD.getDisplayXSize();
dispy=myGLCD.getDisplayYSize();
text_y_center=(dispy/2)-6;
}

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;
uint32_t tx=0;
uint32_t ty=0;
boolean OK = false;

while (OK == false)
{
myGLCD.setColor(255, 255, 255);
myGLCD.print("* PRESS ", CENTER, text_y_center);
while (myTouch.dataAvailable() == false) {}
myGLCD.print("
HOLD! *", CENTER, text_y_center);
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);
myGLCD.setBackColor(255, 0, 0);
readCoordinates();
myGLCD.setColor(255, 255, 255);
myGLCD.print("* RELEASE ", CENTER, text_y_center);
myGLCD.setColor(80, 80, 80);
drawCrossHair(x,y);
rx
=cx;*
_ ry*=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 toHex(uint32_t num)
_
{_
_
buf[0] = '0';_
_
buf[1] = 'x';_
_
buf[10] = 'U';_
_
buf[11] = 'L';_
_
buf[12] = 0;_
_
for (int zz=9; zz>1; zz--)_
_
{_
_
if ((num & 0xF) > 9)_
_
buf[zz] = (num & 0xF) + 55;_
_
else*_
* buf[zz] = (num & 0xF) + 48;*
* num=num>>4;*
* }*
}
void startup()
{
* myGLCD.setColor(255, 0, 0);*
* myGLCD.fillRect(0, 0, dispx-1, 13);*
* myGLCD.setColor(255, 255, 255);*
* myGLCD.setBackColor(255, 0, 0);*
* myGLCD.drawLine(0, 14, dispx-1, 14);*
* myGLCD.print("UTouch Calibration", CENTER, 1);*
* myGLCD.setBackColor(0, 0, 0);*
* if (dispx==220)*
* { *
* myGLCD.print("Use a stylus or something", LEFT, 30);*
* myGLCD.print("similar to touch as close", LEFT, 42);*
* myGLCD.print("to the center of the", LEFT, 54);*
* myGLCD.print("highlighted crosshair as", LEFT, 66);*
* myGLCD.print("possible. Keep as still as", LEFT, 78);*
* myGLCD.print("possible and keep holding", LEFT, 90);*
* myGLCD.print("until the highlight is", LEFT, 102);*
* myGLCD.print("removed. Repeat for all", LEFT, 114);*
* myGLCD.print("crosshairs in sequence.", LEFT, 126);*
* myGLCD.print("Touch screen to continue", CENTER, 162);*
* }*
* else*
* {*
* myGLCD.print("INSTRUCTIONS", CENTER, 30);*
* myGLCD.print("Use a stylus or something similar to", LEFT, 50);*
* myGLCD.print("touch as close to the center of the", LEFT, 62);*
* myGLCD.print("highlighted crosshair as possible. Keep", LEFT, 74);*
* myGLCD.print("as still as possible and keep holding", LEFT, 86);*
* myGLCD.print("until the highlight is removed. Repeat", LEFT, 98);*
* myGLCD.print("for all crosshairs in sequence.", LEFT, 110);*
* myGLCD.print("Further instructions will be displayed", LEFT, 134);*
* myGLCD.print("when the calibration is complete.", LEFT, 146);*
* myGLCD.print("Do NOT use your finger as a calibration", LEFT, 170);*
* myGLCD.print("stylus or the result WILL BE imprecise.", LEFT, 182);*
* myGLCD.print("Touch screen to continue", CENTER, 226);*
* }*
* waitForTouch();*
* myGLCD.clrScr();*
}
void done()
{
* myGLCD.clrScr();*
* myGLCD.setColor(255, 0, 0);*
* myGLCD.fillRect(0, 0, dispx-1, 13);*
* myGLCD.setColor(255, 255, 255);*
* myGLCD.setBackColor(255, 0, 0);*
* myGLCD.drawLine(0, 14, dispx-1, 14);*
* myGLCD.print("UTouch Calibration", CENTER, 1);*
* myGLCD.setBackColor(0, 0, 0);*

* if (dispx==220)*
* { *
* myGLCD.print("To use the new calibration", LEFT, 30);*
* myGLCD.print("settings you must edit the", LEFT, 42);*
* myGLCD.setColor(160, 160, 255);*
* myGLCD.print("UTouchCD.h", LEFT, 54);*
* myGLCD.setColor(255, 255, 255);*
* myGLCD.print("file and change", 88, 54);*
* myGLCD.print("the following values. The", LEFT, 66);*
* myGLCD.print("values are located right", LEFT, 78);*
* myGLCD.print("below the opening comment.", LEFT, 90);*
* myGLCD.print("CAL_X", LEFT, 110);
myGLCD.print("CAL_Y", LEFT, 122);
myGLCD.print("CAL_S", LEFT, 134);
_
toHex(calx);_
_
myGLCD.print(buf, 75, 110);_
_
toHex(caly);_
_
myGLCD.print(buf, 75, 122);_
_
toHex(cals);_
_
myGLCD.print(buf, 75, 134);_
_
}_
_
else*_
* { *
* 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("UTouchCD.h", LEFT, 74);*
* myGLCD.setColor(255, 255, 255);*
* myGLCD.print("file and change", 88, 74);*
* myGLCD.print("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("CAL_X", LEFT, 150);
myGLCD.print("CAL_Y", LEFT, 162);
myGLCD.print("CAL_S", LEFT, 174);
_
toHex(calx);_
_
myGLCD.print(buf, 75, 150);_
_
toHex(caly);_
_
myGLCD.print(buf, 75, 162);_
_
toHex(cals);_
_
myGLCD.print(buf, 75, 174);_
_
}*_

}
void loop()
{
* startup();*

* myGLCD.setColor(80, 80, 80);*
* drawCrossHair(dispx-11, 10);*
* drawCrossHair(dispx/2, 10);*
* drawCrossHair(10, 10);*
* drawCrossHair(dispx-11, dispy/2);*
* drawCrossHair(10, dispy/2);*
* drawCrossHair(dispx-11, dispy-11);*
* drawCrossHair(dispx/2, dispy-11);*
* drawCrossHair(10, dispy-11);*
* myGLCD.setColor(255, 255, 255);*
* myGLCD.setBackColor(255, 0, 0);*
myGLCD.print("", CENTER, text_y_center-12);
myGLCD.print("
", CENTER, text_y_center+12);

* calibrate(10, 10, 0);*
* calibrate(10, dispy/2, 1);*
* calibrate(10, dispy-11, 2);*
* calibrate(dispx/2, 10, 3);*
* calibrate(dispx/2, dispy-11, 4);*
* calibrate(dispx-11, 10, 5);*
* calibrate(dispx-11, dispy/2, 6);*
* calibrate(dispx-11, dispy-11, 7);*

* if (TOUCH_ORIENTATION == LANDSCAPE)
_
cals=(long(dispx-1)<<12)+(dispy-1);_
_
else*_
* cals=(long(dispy-1)<<12)+(dispx-1);*
* if (TOUCH_ORIENTATION == PORTRAIT)
_
px = abs(((float(rx[2]+rx[4]+rx[7])/3)-(float(rx[0]+rx[3]+rx[5])/3))/(dispy-20)); // PORTRAIT*_
* else*
* px = abs(((float(rx[5]+rx[6]+rx[7])/3)-(float(rx[0]+rx[1]+rx[2])/3))/(dispy-20)); // LANDSCAPE*
* if (TOUCH_ORIENTATION == PORTRAIT)
_
{_
_
clx = (((rx[0]+rx[3]+rx[5])/3)); // PORTRAIT*_
* crx = (((rx[2]+rx[4]+rx[7])/3)); // PORTRAIT*
* }*
* else*
* {*
* clx = (((rx[0]+rx[1]+rx[2])/3)); // LANDSCAPE*
* crx = (((rx[5]+rx[6]+rx[7])/3)); // LANDSCAPE*
* }*
* if (clx<crx)*
* {*
_ clx = clx - (px10);
crx = crx + (px
10);
* }*
* else*
* {*
clx = clx + (px10);
crx = crx - (px
10);_

* }*

* if (TOUCH_ORIENTATION == PORTRAIT)
_
py = abs(((float(ry[5]+ry[6]+ry[7])/3)-(float(ry[0]+ry[1]+ry[2])/3))/(dispx-20)); // PORTRAIT*_
* else*
* py = abs(((float(ry[0]+ry[3]+ry[5])/3)-(float(ry[2]+ry[4]+ry[7])/3))/(dispx-20)); // LANDSCAPE*
* if (TOUCH_ORIENTATION == PORTRAIT)
_
{_
_
cty = (((ry[5]+ry[6]+ry[7])/3)); // PORTRAIT*_
* cby = (((ry[0]+ry[1]+ry[2])/3)); // PORTRAIT*
* }*
* else*
* {*
* cty = (((ry[0]+ry[3]+ry[5])/3)); // LANDSCAPE*
* cby = (((ry[2]+ry[4]+ry[7])/3)); // LANDSCAPE*
* }*
* if (cty<cby)*
* {*
_ cty = cty - (py10);
cby = cby + (py
10);
* }*
* else*
* {*
cty = cty + (py10);
cby = cby - (py
10);_

* }*

* calx = (long(clx)<<14) + long(crx);*
* caly = (long(cty)<<14) + long(cby);*
* if (TOUCH_ORIENTATION == LANDSCAPE)
_
cals = cals + (1L<<31);_
_
done();_
_
while(true) {}_
_
}[/quote]*_

Ok perfect, this here is your raw data.

myTouch.read();
x = myTouch.getX(); // raw x
y = myTouch.getY(); // raw y

Now what you need to do is see what the x coords are when you touch the edges of the screen and the same for the y coord.


| | 0
| |
| |
| | Y
| |
| |
| |
|_______________| 5000?
0 X 3550?

how do i se what the x coords are?
is there a place i can se them?
(im am a noob in this)

Maybe orientation problem, try change

#define TOUCH_ORIENTATION  PORTRAIT

to

#define TOUCH_ORIENTATION  LANDSCAPE

UPDATED

For that you will need to make your own display.
I need to see your .cpp and .h files to know exactly what I can write. My library might not be the same as yours.

Also, your code needs to be put into [ code ] ....... [/ code ] tags " # ", NOT quote tags.

#include <UTFT.h>
#include <UTouch.h>

// Define the orientation of the touch screen. Further 
// information can be found in the instructions.
#define TOUCH_ORIENTATION  PORTRAIT

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


// Uncomment the next two lines for the Arduino Mega
UTFT        myGLCD(SSD1963_800,38,39,40,41);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(6,5,4,3,2);

// ************************************
// DO NOT EDIT ANYTHING BELOW THIS LINE
// ************************************
uint32_t cx, cy;
uint32_t rx[10], ry[10];
uint32_t clx, crx, cty, cby;
float px, py;
int dispx, dispy, text_y_center;
uint32_t calx, caly, cals;
char buf[13];

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


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

  myTouch.InitTouch(TOUCH_ORIENTATION);
  myTouch.setPrecision(PREC_LOW);
  dispx=myGLCD.getDisplayXSize();
  dispy=myGLCD.getDisplayYSize();
  text_y_center=(dispy/2)-6;
}

void loop() {

myTouch.read();
tx = myTouch.TP_X;
ty = myTouch.TP_Y;

//Something like this
myGLCD.setColor(0, 0, 0);


    toHex(tx);
    myGLCD.print("X:", 30, 75);
    myGLCD.print(buf, 75, 0);
    toHex(ty);
    myGLCD.print("Y:", 110, 75);
    myGLCD.print(buf, 75, 80);

}
void startup()
{
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, dispx-1, 13);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.drawLine(0, 14, dispx-1, 14);
  myGLCD.print("UTouch Calibration", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);

  if (dispx==220)
  {  
    myGLCD.print("Use a stylus or something", LEFT, 30);
    myGLCD.print("similar to touch as close", LEFT, 42);
    myGLCD.print("to the center of the", LEFT, 54);
    myGLCD.print("highlighted crosshair as", LEFT, 66);
    myGLCD.print("possible. Keep as still as", LEFT, 78);
    myGLCD.print("possible and keep holding", LEFT, 90);
    myGLCD.print("until the highlight is", LEFT, 102);
    myGLCD.print("removed. Repeat for all", LEFT, 114);
    myGLCD.print("crosshairs in sequence.", LEFT, 126);
    myGLCD.print("Touch screen to continue", CENTER, 162);
  }
  else
  {
    myGLCD.print("INSTRUCTIONS", CENTER, 30);
    myGLCD.print("Use a stylus or something similar to", LEFT, 50);
    myGLCD.print("touch as close to the center of the", LEFT, 62);
    myGLCD.print("highlighted crosshair as possible. Keep", LEFT, 74);
    myGLCD.print("as still as possible and keep holding", LEFT, 86);
    myGLCD.print("until the highlight is removed. Repeat", LEFT, 98);
    myGLCD.print("for all crosshairs in sequence.", LEFT, 110);

    myGLCD.print("Further instructions will be displayed", LEFT, 134);
    myGLCD.print("when the calibration is complete.", LEFT, 146);

    myGLCD.print("Do NOT use your finger as a calibration", LEFT, 170);
    myGLCD.print("stylus or the result WILL BE imprecise.", LEFT, 182);

    myGLCD.print("Touch screen to continue", CENTER, 226);
  }

  waitForTouch();
  myGLCD.clrScr();
}
void toHex(uint32_t num)
{
  buf[0] = '0';
  buf[1] = 'x';
  buf[10] = 'U';
  buf[11] = 'L';
  buf[12] = 0;
  for (int zz=9; zz>1; zz--)
  {
    if ((num & 0xF) > 9)
      buf[zz] = (num & 0xF) + 55;
    else
      buf[zz] = (num & 0xF) + 48;
    num=num>>4;
  }
}

the cpp.

/*
  UTouch.cpp - Arduino/chipKit library support for Color TFT LCD Touch screens 
  Copyright (C)2010-2012 Henning Karlsen. All right reserved
  
  Basic functionality of this library are based on the demo-code provided by
  ITead studio. You can find the latest version of the library at
  http://www.henningkarlsen.com/electronics

  If you make any modifications or improvements to the code, I would appreciate
  that you share the code with me so that I might include it in the next release.
  I can be contacted through http://www.henningkarlsen.com/electronics/contact.php

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include "UTouch.h"
#include "UTouchCD.h"

UTouch::UTouch(byte tclk, byte tcs, byte din, byte dout, byte irq)
{
    T_CLK        = tclk;
    T_CS         = tcs;
    T_DIN        = din;
    T_DOUT       = dout;
    T_IRQ        = irq;
}

void UTouch::InitTouch(byte orientation)
{
	orient					= orientation;
	_default_orientation	= CAL_S>>31;
	touch_x_left			= (CAL_X>>14) & 0x3FFF;
	touch_x_right			= CAL_X & 0x3FFF;
	touch_y_top				= (CAL_Y>>14) & 0x3FFF;
	touch_y_bottom			= CAL_Y & 0x3FFF;
	disp_x_size				= (CAL_S>>12) & 0x0FFF;
	disp_y_size				= CAL_S & 0x0FFF;
	prec					= 10;

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

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

void UTouch::touch_WriteData(byte data)
{
	byte temp;
	byte nop;

	temp=data;
	digitalWrite(T_CLK,LOW);

	for(byte 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++;
	}
}

word UTouch::touch_ReadData()
{
	byte nop;
	word data = 0;
	for(byte 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 UTouch::read()
{
	unsigned long tx=0, temp_x=0;
	unsigned long ty=0, temp_y=0;
	int datacount=0;

	digitalWrite(T_CS,LOW);                    

	for (int i=0; i<prec; i++)
	{
		touch_WriteData(0x90);        
		digitalWrite(T_CLK,HIGH);
		digitalWrite(T_CLK,LOW); 
		temp_x=touch_ReadData();

		touch_WriteData(0xD0);      
		digitalWrite(T_CLK,HIGH);
		digitalWrite(T_CLK,LOW);
		temp_y=touch_ReadData();

		if (!((temp_x>max(touch_x_left, touch_x_right)) or (temp_x==0) or (temp_y>max(touch_y_top, touch_y_bottom)) or (temp_y==0)))
		{
			ty+=temp_x;
			tx+=temp_y;
			datacount++;
		}
	}

	digitalWrite(T_CS,HIGH);
	if (datacount>0)
	{
		if (orient == _default_orientation)
		{
			TP_X=tx/datacount;
			TP_Y=ty/datacount;
		}
		else
		{
			TP_X=ty/datacount;
			TP_Y=tx/datacount;
		}
	}
	else
	{
		TP_X=-1;
		TP_Y=-1;
	}
}

bool UTouch::dataAvailable()
{
	bool avail;
	pinMode(T_IRQ,  INPUT);
	avail = !digitalRead(T_IRQ);
	pinMode(T_IRQ,  OUTPUT);
	return avail;
}

int UTouch::getX()
{
	long c;

	if (orient == _default_orientation)
	{
		c = long(long(TP_X - touch_x_left) * (disp_x_size)) / long(touch_x_right - touch_x_left);
		if (c<0)
			c = 0;
		if (c>disp_x_size)
			c = disp_x_size;
	}
	else
	{
		if (_default_orientation == PORTRAIT)
			c = long(long(TP_X - touch_y_top) * (-disp_y_size)) / long(touch_y_bottom - touch_y_top) + long(disp_y_size);
		else
			c = long(long(TP_X - touch_y_top) * (disp_y_size)) / long(touch_y_bottom - touch_y_top);
		if (c<0)
			c = 0;
		if (c>disp_y_size)
			c = disp_y_size;
	}
	return c;
}

int UTouch::getY()
{
	int c;

	if (orient == _default_orientation)
	{
		c = long(long(TP_Y - touch_y_top) * (disp_y_size)) / long(touch_y_bottom - touch_y_top);
		if (c<0)
			c = 0;
		if (c>disp_y_size)
			c = disp_y_size;
	}
	else
	{
		if (_default_orientation == PORTRAIT)
			c = long(long(TP_Y - touch_x_left) * (disp_x_size)) / long(touch_x_right - touch_x_left);
		else
			c = long(long(TP_Y - touch_x_left) * (-disp_x_size)) / long(touch_x_right - touch_x_left) + long(disp_x_size);
		if (c<0)
			c = 0;
		if (c>disp_x_size)
			c = disp_x_size;
	}
	return c;
}

void UTouch::setPrecision(byte precision)
{
	switch (precision)
	{
		case PREC_LOW:
			prec=1;
			break;
		case PREC_MEDIUM:
			prec=10;
			break;
		case PREC_HI:
			prec=25;
			break;
		case PREC_EXTREME:
			prec=100;
			break;
		default:
			prec=10;
			break;
	}
}

the utouch.H

/*
  UTouch.h - Arduino/chipKit library support for Color TFT LCD Touch screens 
  Copyright (C)2010-2012 Henning Karlsen. All right reserved
  
  Basic functionality of this library are based on the demo-code provided by
  ITead studio. You can find the latest version of the library at
  http://www.henningkarlsen.com/electronics

  If you make any modifications or improvements to the code, I would appreciate
  that you share the code with me so that I might include it in the next release.
  I can be contacted through http://www.henningkarlsen.com/electronics/contact.php

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef UTouch_h
#define UTouch_h

#if defined(ARDUINO) && ARDUINO >= 100
	#include "Arduino.h"
#else
	#include "WProgram.h"
#endif

#define PORTRAIT			0
#define LANDSCAPE			1

#define PREC_LOW			1
#define PREC_MEDIUM			2
#define PREC_HI				3
#define PREC_EXTREME		4

class UTouch
{
	public:
		word	TP_X ,TP_Y;

				UTouch(byte tclk, byte tcs, byte tdin, byte dout, byte irq);

		void	InitTouch(byte orientation = LANDSCAPE);
		void	read();
		bool	dataAvailable();
		int		getX();
		int		getY();
		void	setPrecision(byte precision);
    
    private:
		byte	T_CLK, T_CS, T_DIN, T_DOUT, T_IRQ;
		long	_default_orientation;
		byte	orient;
		byte	prec;
		byte	display_model;
		long	disp_x_size, disp_y_size, default_orientation;
		long	touch_x_left, touch_x_right, touch_y_top, touch_y_bottom;

		void	touch_WriteData(byte data);
		word	touch_ReadData();
};

#endif

Oh wow, your library has nothing but the bare basics. Not going to lie, but it is going to be tough to write your sketch.

I Hope You Can Help i know alot have The same problem

Maybe orientation problem, try change

#define TOUCH_ORIENTATION  PORTRAIT

to

#define TOUCH_ORIENTATION  LANDSCAPE

Its not The orientation the touch library is only scaled for 320x240

What does x,0,0,0,0 mean here wich cordinates so i set where?

  tx = map( X, 0, 3550, 0, 239); // the screen data for X
  ty = map( Y, 0, 4860, 0, 319); // the screen data for Y

nonamejohn:
What does x,0,0,0,0 mean here wich cordinates so i set where?

  tx = map( X, 0, 3550, 0, 239); // the screen data for X

ty = map( Y, 0, 4860, 0, 319); // the screen data for Y

that is the map function, it works like this.
mapped output = map( your inputted data, lowest value of the data, highest value of data, lowest value you need, highest value you need)

I just updated my sketch in reply #11, try it

i got it working but when i move on the screen the number goes from 100 til 990 and then starts from 100 and goes up til 500 on the x axis shouldi take this numer as 1500??

Are you looking at the raw data or mapped data? The thing about maps is, they do not stay in range. meaning if your Highest value is say 500, and the map goes over that, it will give you unwanted results.
they way to fix this is by using a constrain.

constrain(tx, lowest mapped value, highest mapped value);
constrain(ty, lowest mapped value, highest mapped value);

so finaly go it calibratet i think yousing the serial.print funktion but a new problem the x and y axis is invertet:/

Post your full code and I'll take a look at it.

its always been a broblem that the x and y axis whas ivertet no mater what eksamlpe i use from utouch

// UTouch_QuickDraw (C)2010-2012 Henning Karlsen
// web: Electronics - Henning Karlsen
//
// This program is a quick demo of how to use the library.
//
// This program requires the UTFT library.
//
// It is assumed that the display module is connected to an
// appropriate shield or that you know how to change the pin
// numbers in the setup.
//

#include <UTFT.h>
#include <UTouch.h>
#define TOUCH_ORIENTATION LANDSCAPE

// Uncomment the next two lines for the Arduino 2009/UNO
//UTFT myGLCD(ITDB24D,19,18,17,16); // Remember to change the model parameter to suit your display module!
//UTouch myTouch(15,10,14,9,8);

// Uncomment the next two lines for the Arduino Mega
UTFT myGLCD(SSD1963_800, 38,39,40,41); // Remember to change the model parameter to suit your display module!
UTouch myTouch(6,5,4,3,2);
int val;
int tx;
int ty;
void setup()
{
Serial.begin(9600);
myGLCD.InitLCD();
myGLCD.clrScr();

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

void loop()
{
long x, y;
val = (myTouch.dataAvailable() == true); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 479, 0, 799);
while (myTouch.dataAvailable() == true)
{
myTouch.read();
x = myTouch.getX();
y = myTouch.getY();

tx = map( x, 0, 291, 0, 491); // the screen data for X
ty = map( y, 0, 145, 0, 261); // the screen data for Y

{
myGLCD.drawPixel(tx, ty);
}
}
}