cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get the Touch function running properly XPT2046

ZExpo.1
Senior

Hello All,

               I have set XPT2046 and set sample touch as specified by the documentation and I have getting coordinates accordingly but the problem is when I try to press the button I register the X, and Y coordinates but there is a delayed response, or the key is registered but touch gfx doesn't process forward.

Touch Strokes are working fine when touch is pressed according to Debugger.

CHECK THE VIDEO LINK BELOW FOR CLARIFICATION

VIDEO

@jiangfan 

@Osman SOYKURT 

 

 

10 REPLIES 10

@Mohammad MORADI ESFAHANIASL 

This is the final routine that I am using

 

bool STM32TouchController::sampleTouch(int32_t& x, int32_t& y)
{
	if (XPT2046_TouchPressed()) {
				XPT2046_TouchGetCoordinates((uint16_t*) &x, (uint16_t*) &y);
				x_axis=x;
				y_axis=y;
				return true;
			}
	    return false;
}