Hello,
Am using iMXRT1064 with Emwin library and 7" resistive touch screen. I am using a custom ADC driver to read x and y values.
// points p0,p1,p2 x and y pixels
int touchRefValX[3] = {40,760,400};
int touchRefValY[3] = {24,240,456};
// ADC x and y values at above points
int touchSampleValX[3] = {2552,1528,1954};
int touchSampleValY[3] = {2295,1960,1803};
the range of ADC values for x and y are always in around 1400 counts to 2500 counts.for 12 bit range should be 0-4096.
// init
GUI_TOUCH_CalcCoefficients(3, &touchRefValX[0], &touchRefValY[0], &touchSampleValX[0], &touchSampleValY[0], 800, 480);
GUI_TOUCH_EnableCalibration(1);
//read touch
pressed = get_adc(&touchX,&touchY)
if(pressed == TRUE){
touchState.Pressed = TRUE;
touchState.x = touchX;
touchState.y = touchY;
GUI_TOUCH_StoreStateEx(&touchState);
prevState = pressed;
}
else if(prevState != pressed){
touchState.x = -1;
touchState.y = -1;
touchState.Pressed = FALSE;
prevState = pressed;
GUI_TOUCH_StoreStateEx(&touchState);
}
I get the pressed and un-pressed but actual touch it does not work as expected.
i was able to debug and found that i don't get the release events always. When i get the release event then it works as expected.
I mostly get the WM_NOTIFICATION_CLICKED and WM_NOTIFICATION_MOVED_OUT events but rarely get the WM_NOTIFICATION_RELEASED event.
What am i doing wrong? Any sample code with similar configuration would be helpful.
Thanks & Regards
Anuj
Am using iMXRT1064 with Emwin library and 7" resistive touch screen. I am using a custom ADC driver to read x and y values.
// points p0,p1,p2 x and y pixels
int touchRefValX[3] = {40,760,400};
int touchRefValY[3] = {24,240,456};
// ADC x and y values at above points
int touchSampleValX[3] = {2552,1528,1954};
int touchSampleValY[3] = {2295,1960,1803};
the range of ADC values for x and y are always in around 1400 counts to 2500 counts.for 12 bit range should be 0-4096.
// init
GUI_TOUCH_CalcCoefficients(3, &touchRefValX[0], &touchRefValY[0], &touchSampleValX[0], &touchSampleValY[0], 800, 480);
GUI_TOUCH_EnableCalibration(1);
//read touch
pressed = get_adc(&touchX,&touchY)
if(pressed == TRUE){
touchState.Pressed = TRUE;
touchState.x = touchX;
touchState.y = touchY;
GUI_TOUCH_StoreStateEx(&touchState);
prevState = pressed;
}
else if(prevState != pressed){
touchState.x = -1;
touchState.y = -1;
touchState.Pressed = FALSE;
prevState = pressed;
GUI_TOUCH_StoreStateEx(&touchState);
}
I get the pressed and un-pressed but actual touch it does not work as expected.
i was able to debug and found that i don't get the release events always. When i get the release event then it works as expected.
I mostly get the WM_NOTIFICATION_CLICKED and WM_NOTIFICATION_MOVED_OUT events but rarely get the WM_NOTIFICATION_RELEASED event.
What am i doing wrong? Any sample code with similar configuration would be helpful.
Thanks & Regards
Anuj
The post was edited 2 times, last by anuj.tanksali ().