OpenEdv-开源电子网

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

求助,液晶屏LCD 菜单列表具体含义?

[复制链接]

2

主题

8

帖子

0

精华

新手上路

积分
36
金钱
36
注册时间
2015-10-18
在线时间
0 小时
发表于 2015-10-26 00:07:23 | 显示全部楼层 |阅读模式
5金钱
我参考 http://www.openedv.com/posts/list/34672.htm 的“源码”,实现了128*64液晶显示,目前菜单也可以切换显示,但是我不理解 菜单列表 具体是怎么跳转的,望高手指点。
菜单切换部分过程: 按down后 由*fun1*fun2, 按down后*fun2→*fun3,再按down后*fun3→*fun3按up后*fun3→*fun2按up后*fun2→*fun1,再按up后*fun1→*fun1 enter*fun1→*fun4,再按num_ent或者up都是*fun4不变。现在不想这样试下去,谁能解释一下菜单列表 具体是怎么跳转的????


[mw_shl_code=c,true]#include "led.h" #include "delay.h" #include "sys.h" #include "usart.h" #include "lcd.h" //#include "usmart.h" #include "rtc.h" #include "fun.h" #include "key.h" #include "stm32f10x_encoder.h" #include "stm32f10x.h" #include"stm32f10x_conf.h" ////ALIENTEK Mini STM32??·?°?·????ú??13 ////RTC???±?±?????é ////?????§????www.openedv.com ////?????????í??×????????????? u8 func_index=0; void (*current_operation_index)(); //?????±?°???????? typedef struct { u8 current; //?±?°×????? u8 up;//?ò??·??÷???? u8 down;//?ò??·??÷???? u8 enter;//?·???÷???? u8 num_ent;//±à???÷?·???ü void (*current_operation)(); //???????????? } key_table; key_table table[32]= {    [/mw_shl_code] [mw_shl_code=c,true]        {0,0,1,3,0,(*fun1)}, {1,0,2,7,1,(*fun2)}, //??????????±í {2,1,2,11,2,(*fun3)}, {3,3,4,0,3,(*fun4)}, {4,3,5,0,4,(*fun5)}, {5,4,6,0,5,(*fun6)}, {6,5,6,0,6,(*fun7)}, {7,7,8,15,7,(*fun8)}, {8,7,9,19,8,(*fun9)}, {9,8,10,23,9,(*fun10)}, {10,9,10,1,10,(*fun11)}, {11,11,12,28,11,(*fun12)}, {12,11,13,31,12,(*fun13)}, {13,12,14,13,13,(*fun14)}, {14,13,14,2,14,(*fun15)}, {15,15,16,15,25,(*fun16)}, {16,15,17,16,25,(*fun17)}, {17,16,18,17,25,(*fun18)}, {18,17,18,7,18,(*fun19)}, {19,19,20,19,26,(*fun20)}, {20,19,21,20,26,(*fun21)}, {21,20,22,21,26,(*fun22)}, {22,21,22,8,22,(*fun23)}, {23,23,24,23,27,(*fun24)}, {24,23,24,9,24,(*fun25)}, {25,7,7,7,7,(*fun26)}, {26,8,8,8,8,(*fun27)}, {27,9,9,9,9,(*fun28)}, {28,28,29,30,28,(*fun29)}, {29,28,29,30,29,(*fun30)}, {30,11,11,11,11,(*fun31)}, {31,12,12,12,12,(*fun32)} }; int main(void) { u8 num; delay_init(); //???±???????? LED_Init(); //????????LED?????????????? InitLCD(); while(1) { num = KEY_Scan();//?????ü?? switch(num) { case 1: ClearScreen(); func_index=table[func_index].up; LED0=!LED0; break; //?ò??·? S6 case 2: ClearScreen(); func_index=table[func_index].down; LED1=!LED1; break; //?ò??·? S7 case 3: ClearScreen(); func_index=table[func_index].enter; LED2=!LED2; break; //?·?? S5 case 4: ClearScreen(); func_index=table[func_index].num_ent; LED3=!LED3; // S8 break; default: delay_ms(10); } current_operation_index=table[func_index].current_operation; (*current_operation_index)(); } } [/mw_shl_code]

最佳答案

查看完整内容[请看2#楼]

结合结构体理解,一个按键对应一个结构体元素,按键动作后只要跳转到当前页面对应元素指向页面即可
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

72

主题

2711

帖子

2

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
3505
金钱
3505
注册时间
2014-8-4
在线时间
696 小时
发表于 2015-10-26 00:07:24 | 显示全部楼层
结合结构体理解,一个按键对应一个结构体元素,按键动作后只要跳转到当前页面对应元素指向页面即可
以我资质之鲁钝,当尽平心静气、循序渐进、稳扎稳打之力。
回复

使用道具 举报

2

主题

8

帖子

0

精华

新手上路

积分
36
金钱
36
注册时间
2015-10-18
在线时间
0 小时
 楼主| 发表于 2015-10-26 21:00:49 | 显示全部楼层
回复【2楼】龙之谷:
---------------------------------
还是不理解,你能结合我的代码解释一下吗?写在纸上排个照片也行。
回复

使用道具 举报

2

主题

8

帖子

0

精华

新手上路

积分
36
金钱
36
注册时间
2015-10-18
在线时间
0 小时
 楼主| 发表于 2015-10-27 07:49:59 | 显示全部楼层
回复【2楼】龙之谷:
---------------------------------
我现在想明白了
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-6-19 06:16

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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