标题:
STM32F103ZET6 LCD12864液晶多级菜单源码
[打印本页]
作者:
Tang_xiao
时间:
2018-8-4 23:18
标题:
STM32F103ZET6 LCD12864液晶多级菜单源码
1.LCD液晶多级菜单源码
2.STM32+12864实现多级文字菜单的切换
单片机源程序如下:
/**
******************************************************************************
* @file main.c
* @author SUNZHENGYUAN
* @version V1.0
* @date 2013-xx-xx
* @brief 工程项目
******************************************************************************
* @attention
*
* 项目平台:STM32F103ZET6
*
*
*
******************************************************************************
*/
/*=====================================================================================
函数名称:
功能描述:
全局变量:
参数说明:
返回说明:
设 计 人:
版 本:
说 明:
======================================================================================*/
#include "stm32f10x.h"
#include "Param.h"
#include "GPIO.h"
#include "Lcd.h"
#include "function.h"
uchar func_index=0;
uchar one=0;
void (*current_operation_index)();
typedef struct
{
uchar current;
uchar up;
uchar down;
uchar right;
uchar enter;
void (*current_operation)();
} key_table;
key_table tables[Menu_Num]=
{
{0,3,1,1,4,(*fun_main_1)},
{1,0,2,0,1,(*fun_main_2)},
{2,1,3,3,11,(*fun_main_3)},
{3,2,0,2,10,(*fun_main_4)},
{4,9,5,4,4,(*fun_measure_1)},
{5,4,6,5,5,(*fun_measure_2)},
{6,5,7,6,6,(*fun_measure_3)},
{7,6,8,7,7,(*fun_measure_4)},
{8,7,9,8,0,(*fun_measure_5)},
{9,8,4,9,9,(*fun_measure_6)},
{10,0,0,0,0,(*fun_document_1)},
{11,13,12,16,16,(*fun_enable_1)},
{12,11,13,0,0,(*fun_enable_2)},
{13,12,11,14,14,(*fun_enable_3)},
{14,15,15,13,13,(*fun_enable_4)},
{15,14,14,13,13,(*fun_enable_5)},
{16,17,17,11,11,(*fun_enable_6)},
{17,16,16,11,11,(*fun_enable_7)},
};
/**
* @brief 主函数
* @param 无
* @retval 无
*/
int main(void)
{
GPIO_Config();
Lcd_12864_Init();
Lcd_12864_Clear_AllScreen();
while(1)
{
/*******************find index****************************/
if((keyup==0)||(keydown==0)||(keyenter==0)||(keyright==0))
{
Delay_(10);
if(keyup==0)
{
func_index=tables[func_index].up;
one=0;
while(!keyup);
}
if(keydown==0)
{
func_index=tables[func_index].down;
one=0;
while(!keydown);
}
if(keyenter==0)
{
func_index=tables[func_index].enter;
one=0;
while(!keyenter);
}
if(keyright==0)
{
func_index=tables[func_index].right;
one=0;
while(!keyright);
}
}
if(one==0)
{
// Lcd_12864_Clear_AllScreen();
// Lcd_12864_Init();
current_operation_index=tables[func_index].current_operation;
(*current_operation_index)();
one=1;
}
}
}
/*********************************************END OF FILE**********************/
复制代码
全部资料51hei下载地址:
液晶多级菜单.zip
(1.78 MB, 下载次数: 278)
2018-8-4 23:18 上传
点击文件名下载附件
下载积分: 黑币 -5
作者:
氺魔尊丿
时间:
2018-8-15 22:57
我一事不明,就代码中的LCD_CS和LCD_RS,前者是12864的片选,那后这是模拟IIC的吗?
作者:
氺魔尊丿
时间:
2018-8-15 22:58
代码中的LCD_RS和LCD_CS分别是指?
作者:
JIANGJING520
时间:
2018-11-5 14:15
学习了学习了
作者:
530157193
时间:
2018-11-28 11:00
楼主可以给个插线方法吗
作者:
汶尔雅
时间:
2018-12-10 22:19
感谢楼主,学习了
作者:
liyvg
时间:
2018-12-11 10:59
谢楼主分享,学习一下。
作者:
952122689
时间:
2018-12-20 13:18
学习了,谢谢楼主
作者:
952122689
时间:
2018-12-20 19:51
打不开老铁
作者:
小林大哥哥
时间:
2019-7-21 15:07
我一事不明,就代码中的LCD_CS和LCD_RS,前者是12864的片选,那后这是模拟IIC的吗?
作者:
vlivli
时间:
2019-10-16 14:59
下载学习下。
作者:
530157193
时间:
2019-12-3 19:26
我想问下key_table tables[Menu_Num]=里的5个数字是怎么确定的啊
作者:
ywjianghu
时间:
2020-2-12 00:25
本帖最后由 ywjianghu 于 2020-2-12 21:58 编辑
不知什么原因,不能解压。今天换了个解压软件,可以了。
作者:
2205032091
时间:
2025-4-23 16:17
楼主这个字模取模格式是什么啊
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1