OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 5634|回复: 0

F4的4.3寸触摸屏实验

[复制链接]

21

主题

51

帖子

0

精华

初级会员

Rank: 2

积分
140
金钱
140
注册时间
2015-12-4
在线时间
10 小时
发表于 2015-12-29 17:05:34 | 显示全部楼层 |阅读模式
我的4.3寸触摸屏按照教程一步一步进行移植的,为何在测试如下函数时,可以显示字符,但点击屏幕时,不会有任何反应?这是为何呢?(以下是从segger官网下载来的测试程序),
实在是找不出其他的原因了,所以希望各位大神给点思路...


void MainTask(void) {
       
        GUI_PID_STATE TouchState;
        int xPhys;
        int yPhys;
        GUI_Init();
       
        // // Check if recommended memory for the sample is available //
       
        if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
       
                GUI_ErrorOut("Not enough memory available.");
                return;
         }
         
        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 (1) {
                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);
         };
}


正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-2-25 21:40

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表