Hi @kerryzhou ,
I meant i don't get the release events always when i press the LCD. As am using Emwin library i pass the raw ADC touchx and touchy to emwin by using GUI_TOUCH_StoreStateEx(&touchState); as show above in my code. It is expected that i get the the WM_NOTIFICATION_CLICKED event from Emwin library when i press the LCD and WM_NOTIFICATION_RELEASED event from Emwin library when i release the LCD.
The latest development in this regard is below,
I re-calibrated the LCD multiple times using standard 9 point calibration and increased the size of the widgets due to which there is improvement and i get the WM_NOTIFICATION_CLICKED and WM_NOTIFICATION_RELEASED events.
But it does not always work 100% of the time. I think it has to do with the default calibration points which are passed to Emwin to calibrate the Touch.
below are the points used
// Pixel coordinates
int touchRefValX[9] = {40,400,760,40,400,760,40,400,760};
int touchRefValY[9] = {24,24,24,240,240,240,456,456,456};
// ADC values
int touchSampleValX[9] = {2561,1958,1531,2561,1961,1531,2564,1959,1526};
int touchSampleValY[9] = {2308,2304,2305,1970,1966,1955,1772,1764,1764};
The above points are applied using emwin api's below
// Set the calibration coefficients.
GUI_TOUCH_CalcCoefficients(9, &touchRefValX[0], &touchRefValY[0], &touchSampleValX[0], &touchSampleValY[0], 800, 480);
// Enable use of above calibration coefficients.
GUI_TOUCH_EnableCalibration(TRUE);
Attached is the excel containing the log of ADC x and y values. using the values in excel average x and y are taken for each point and used for GUI_TOUCH_CalcCoefficients.
Please let me know if any inputs.
Thanks
Regards
Anuj