I can't do any tests to confirm this, but the getPoint() function in the TouchScreen.cpp file doesn't look correct.
Point TouchScreen::getPoint(void) {
int x, y, z;
int samples[NUMSAMPLES];
uint8_t i, valid;
uint8_t xp_port = digitalPinToPort(_xp);
uint8_t yp_port = digitalPinToPort(_yp);
uint8_t xm_port = digitalPinToPort(_xm);
uint8_t ym_port = digitalPinToPort(_ym);
uint8_t xp_pin = digitalPinToBitMask(_xp);
uint8_t yp_pin = digitalPinToBitMask(_yp);
uint8_t xm_pin = digitalPinToBitMask(_xm);
uint8_t ym_pin = digitalPinToBitMask(_ym);
valid = 1;
pinMode(_yp, INPUT);
pinMode(_ym, INPUT);
*portOutputRegister(yp_port) &= ~yp_pin; // this should not be here, this sets the pin you want to read (A2) to low
*portOutputRegister(ym_port) &= ~ym_pin;
//digitalWrite(_yp, LOW);
//digitalWrite(_ym, LOW);
pinMode(_xp, OUTPUT);
pinMode(_xm, OUTPUT);
//digitalWrite(_xp, HIGH);
//digitalWrite(_xm, LOW);
*portOutputRegister(xp_port) |= xp_pin;
*portOutputRegister(xm_port) &= ~xm_pin;
for (i=0; i<NUMSAMPLES; i++) {
samples = analogRead(_yp);[/b] <- Then tries to read the low pin
* }*
#if NUMSAMPLES > 2
* insert_sort(samples, NUMSAMPLES);
__#endif*__
#if NUMSAMPLES == 2
* if (samples[0] != samples[1]) { valid = 0; }*
#endif
_ x = (1023-samples[NUMSAMPLES/2]); // 1023 - 0 is going to return 1023_
* pinMode(_xp, INPUT);
pinMode(_xm, INPUT);
portOutputRegister(xp_port) &= ~xp_pin;
//digitalWrite(_xp, LOW);
* pinMode(yp, OUTPUT);
portOutputRegister(yp_port) |= yp_pin;
//digitalWrite(_yp, HIGH);
* pinMode(ym, OUTPUT);
portOutputRegister(ym_port) &= ~ym_pin; <- this is needed to properly read _xm, without this, _xm will always be high
__ for (i=0; i<NUMSAMPLES; i++) {
samples = analogRead(_xm);[/b]
* }*
#if NUMSAMPLES > 2
* insert_sort(samples, NUMSAMPLES);
__#endif*
#if NUMSAMPLES == 2
* if (samples[0] != samples[1]) { valid = 0; }
#endif*
_ y = (1023-samples[NUMSAMPLES/2]); <- 1023 - "aprox" 1023 = 0 or 1_
* // Set X+ to ground*__
* pinMode(_xp, OUTPUT);
portOutputRegister(xp_port) &= ~xp_pin;
//digitalWrite(_xp, LOW);
* // Set Y- to VCC*
portOutputRegister(ym_port) |= ym_pin;
//digitalWrite(_ym, HIGH);*
* // Hi-Z X- and Y+*
portOutputRegister(yp_port) &= ~yp_pin;
//digitalWrite(_yp, LOW);
pinMode(_yp, INPUT);*
* int z1 = analogRead(_xm);
int z2 = analogRead(yp);
if (rxplate != 0) {
__ // now read the x*
* float rtouch;
rtouch = z2;
rtouch /= z1;
rtouch -= 1;*__
rtouch *= x;
rtouch = _rxplate;
__ rtouch /= 1024;*__
* z = rtouch;*
* } else {*
* z = (1023-(z2-z1));*
* }*
* if (! valid) {*
* z = 0;*
* }*
* return Point(x, y, z);*
}[/quote]
Make those changes and it should work like normal.