>_<:直接调用函数获得触屏位置:
- xPhys = GUI_TOUCH_GetxPhys(); /* Get the A/D mesurement result in x */
- yPhys = GUI_TOUCH_GetyPhys(); /* Get the A/D mesurement result in y */
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAy4AAAIGCAIAAAA9WUwTAAAbGElEQVR4nO3dS3BU950v8F7PirLL+9zKjacq+6m6e22DNqjYWGR2GLwwqTFmlhec8BDYPOwpJ3HsIDCpcjAOIhNiHrENGPGUEKDmYUk8xEsInMfcyeZOzS3uoh863ef040iNfgJ/PvUtVev0+T+6m8W3TreaQiFhMQAA86JQV8K6u7u3bd8xdPH6nQd/FREREZGnlPGbdwcOHOju7i4XssWLF//4x/98dvjKV8PjIiIiIjIPuT4++eMf/3OhUCh0d3efHb7y1YUJEREREZm3XB+fLCxevHjDhs3HLkyIiIiIyDynsHjx4qGL14+P3BARERGReU5h8eLF09/+5/GLN0VERERknlOuYicu3hQRERGReU65in196ZaIiIiIzHPKVezk5dsiIiIiMs8pV7HB0cnM/I//+fJ02w6euNBoHhEREXmOc+TU1X/befCnWz/pbP5t58Ejp64+T0uk06KKTU9PH2vbokWLwv8piIiIyPxny/v7j568fGn8fmdz9OTlLe/vf56WSKdcxU4V72SmVMX6+/sHKu7duzc9XaymenxwcHDRokWN5hEREZHnOD/d+snIN/e+OD/W2Yx8c++nWz95npZIp1zFTl+5m5lSFRsYGDh27Njf//73H/6w8NJLNVm0aNGiRYuqVazRPJInw5te7fmXvfO13LGdr3S/vunYbIfv3dj16s7f5xv1x3/p3vhR/PMsIiIdy8+2/fbS2P0vh8Y7m0tj93+27beBS3wxNPbF0Fjl9viXQ+Nfnq/N0PiXQ2Nfnq/+HP9iaOauL4bGv6hdIp1yFTtz9V5mklXsyZPiSy8VCoXXSvnqq38oFgvFYuG11wrVKlY7/ELfqz1v7EtP+/kb3T1dpfzvz6tndlUPdm/8dYP9lIe/uvMPV++d2bfxlfcvpOZ8ve941qjjO1+pzJ/YUuaozIMX+l5N7er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AMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFUMQCAMKoYAEAYVQwAIIwqBgAQRhUDAAijigEAhFHFAADCqGIAAGFyVDERERERedpRxURERETCooqJiIiIhEUVExEREQmLKiYiIiISFlVMREREJCzlKiYiIiIi85/CjwAACPL/AUk4lQtNVfyOAAAAAElFTkSuQmCC" alt="" width="611" height="389" />
void MainTask_touch(void) {
GUI_Init();
GUI_CURSOR_Show();
GUI_CURSOR_Select(&GUI_CursorCrossL);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_Clear();
GUI_DispString("Measurement of\nA/D converter values");
while () {
GUI_PID_STATE TouchState;
int xPhys, yPhys;
GUI_TOUCH_GetState(&TouchState); /* Get the touch position in pixel */
xPhys = GUI_TOUCH_GetxPhys(); /* Get the A/D mesurement result in x */
yPhys = GUI_TOUCH_GetyPhys(); /* Get the A/D mesurement result in y */
/* Display the measurement result */
GUI_SetColor(GUI_BLUE);
GUI_DispStringAt("Analog input:\n", , );
GUI_GotoY(GUI_GetDispPosY() + );
GUI_DispString("x:");
GUI_DispDec(xPhys, );
GUI_DispString(", y:");
GUI_DispDec(yPhys, );
/* Display the according position */
GUI_SetColor(GUI_RED);
GUI_GotoY(GUI_GetDispPosY() + );
GUI_DispString("\nPosition:\n");
GUI_GotoY(GUI_GetDispPosY() + );
GUI_DispString("x:");
GUI_DispDec(TouchState.x,);
GUI_DispString(", y:");
GUI_DispDec(TouchState.y,);
/* Wait a while */
GUI_Delay();
};
}