LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TOUCH_Sample.c
Go to the documentation of this file.
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH & Co. KG *
3 * Solutions for real time microcontroller applications *
4 **********************************************************************
5 * *
6 * (c) 1996 - 2012 SEGGER Microcontroller GmbH & Co. KG *
7 * *
8 * Internet: www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 
12 ** emWin V5.14 - Graphical user interface for embedded applications **
13 emWin is protected by international copyright laws. Knowledge of the
14 source code may not be used to write a similar product. This file may
15 only be used in accordance with a license and should not be re-
16 distributed in any way. We appreciate your understanding and fairness.
17 ----------------------------------------------------------------------
18 File : TOUCH_Sample.c
19 Purpose : Shows how to access a touch panel without using buttons
20 ---------------------------END-OF-HEADER------------------------------
21 */
22 
23 #include "GUI.h"
24 
25 /*********************************************************************
26 *
27 * Public code
28 *
29 **********************************************************************
30 */
31 /*********************************************************************
32 *
33 * MainTask
34 */
35 void MainTask(void) {
36  GUI_Init();
37  GUI_CURSOR_Show();
38  GUI_CURSOR_Select(&GUI_CursorCrossL);
39  GUI_SetBkColor(GUI_WHITE);
40  GUI_SetColor(GUI_BLACK);
41  GUI_Clear();
42  GUI_DispStringAt("Measurement of\nDigital values",0,5);
43  while (1) {
44  GUI_PID_STATE TouchState;
45  GUI_TOUCH_GetState(&TouchState); /* Get the touch position in pixel */
46  /* Display the measurement result */
47  GUI_SetColor(GUI_BLUE);
48  GUI_DispStringAt("\nPosition:\n",10,20);
49  GUI_GotoY(GUI_GetDispPosY() + 2);
50  GUI_DispString("x:");
51  GUI_DispDec(TouchState.x,4);
52  GUI_DispString(", y:");
53  GUI_DispDec(TouchState.y,4);
54  /* Wait a while */
55  GUI_Delay(100);
56  };
57 }
58 
59 /*************************** End of file ****************************/
60