⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maintask.c

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 C
字号:
/**********************************************************************                SEGGER MICROCONTROLLER SYSTEME GmbH                 **        Solutions for real time microcontroller applications        ************************************************************************                                                                    **           (C) 2000    SEGGER Microcontroller Systeme GmbH          **                                                                    **        Internet: www.segger.com    Support:  support@segger.com    **                                                                    ***********************************************************************File        : TOUCH_Sample.cPurpose     : Mesurement of A/D converter values of a analog touch panel---------------------------END-OF-HEADER------------------------------*/#include "GUI.h"/*********************************************************************       MainTask**********************************************************************/
void LCD_WriteRAM_Prepare(void); 
void LCD_L0_SetPixelIndex(int,int,int);void MainTask(void) 
{
  LCD_WriteRAM_Prepare();
  LCD_L0_SetPixelIndex(0,0,0xFFFF);  GUI_Init();  GUI_CURSOR_Show(); // GUI_CURSOR_Select(&GUI_CursorCrossL);  GUI_SetBkColor(GUI_BLACK);  GUI_SetColor(GUI_WHITE);  GUI_Clear();  GUI_DispString("Measurement of\nA/D converter values");  while (1) {    GUI_PID_STATE TouchState;    int xPhys, yPhys;
	GUI_DrawHLine(0,0,100);    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", 0, 20);    GUI_GotoY(GUI_GetDispPosY() + 2);    GUI_DispString("x:");    GUI_DispDec(xPhys, 4);    GUI_DispString(", y:");    GUI_DispDec(yPhys, 4);    /* Display the according position */    GUI_SetColor(GUI_RED);    GUI_GotoY(GUI_GetDispPosY() + 4);    GUI_DispString("\nPosition:\n");    GUI_GotoY(GUI_GetDispPosY() + 2);    GUI_DispString("x:");    GUI_DispDec(TouchState.x,4);    GUI_DispString(", y:");    GUI_DispDec(TouchState.y,4);    /* Wait a while */    GUI_Delay(100);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -