產(chǎn)品動態(tài)
- A規(guī)京瓷7寸全視角寬溫液晶屏TCG070WV
- (已停產(chǎn))三菱12.1寸工控用屏AA121X
- (已停產(chǎn))三菱7寸工控液晶屏AT070M
- (已停產(chǎn))三菱7寸超寬溫高亮工業(yè)屏
- (已停產(chǎn))三菱7寸工控液晶模組AA0
- P495IVN01.0 友達(dá)49.5寸 分辨率1920*540 亮度
- 友達(dá)49.5寸 P495IVN02.0 分辨率1920*540 表面
- 友達(dá)24寸 M240UAN01.0 分辨率1920*1200 對比
- G238HAN01.5 友達(dá)23.8寸 高分辨率1920*108
- G156HAT01.4 友達(dá)15.6寸 分辨率1920*1080 全
全國統(tǒng)一服務(wù)熱線:
15382323032
客服QQ:3234659108
手機(jī):15382323032
地址:浙江省杭州市西湖區(qū)文一西路830號蔣村商務(wù)中心B樓2-8007室
12864液晶屏如何去做多級菜單?
現(xiàn)在很多的工程師在使用12864液晶屏?xí)r,都會碰到應(yīng)該如何做多級菜單的問題,去請教供應(yīng)商吧,往往是得不到想要的答案的,去問百度吧,又不能夠確定答案是否正確,難!今天,我們就請杭州精顯的工程師來給您一個12864液晶屏如何做多級菜單的范例。
#include "menu_level1.h"
#include "./Driver/key/key.h"
#include "./Driver/SysInterrupt/SetInterruptStatus.h"
#include "./Driver/LCD12864/ms12864r.h"
#include "./Driver/LCD12864/menu_function.h"
#include "haitun.h"
#include "aaa.h"
//全局變量引入
extern unsigned int menu_list_roll_choice;
extern unsigned int TimeBase128;
const unsigned int hand_bmp1[16]= //手型字符
{
0x0000, 0x0180, 0x0360, 0x0550, 0x0558, 0x0554, 0x0554, 0x7554,
0x4d54, 0x2404, 0x1004, 0x1004, 0x0804, 0x0408, 0x03f8, 0x07f8
};
const unsigned int hand_bmp2[16]= //手型字符
{
0x0000, 0x0400, 0x0a00, 0x0a00, 0x0b50, 0x0aa8, 0x0aa8, 0x1aa8,
0x2aa8, 0x2808, 0x2808, 0x2008, 0x1008, 0x0808, 0x07f0, 0x0ff0
};
//菜單數(shù)組
const unsigned int menu_1_0[7][16] = //一級菜單
{
{"1.字符顯示演示 "},
{"2.數(shù)據(jù)顯示演示 "},
{"3.光標(biāo)閃爍開關(guān) "},
{"4.圖形顯示演示 "},
{"5.動畫演示 "},
{"6.點(diǎn)畫圖形 "},
{"7.版本信息.. "}
};
const unsigned int menu_1_1[2][16] =
{
{"1.字符顯示演示 "},
{"enter 鍵返回 "}
};
const unsigned int menu_1_2[2][16] =
{
{"2.數(shù)據(jù)顯示演示 "},
{"+,-,enter返回 "}
};
const unsigned int menu_1_3[1][16] =
{
{"3.光標(biāo)閃爍開關(guān) "},
};
const unsigned int menu_1_4[2][16] =
{
{"4.圖形顯示演示 "},
{"+,-,enter 返回 "}
};
const unsigned int menu_1_5[0][16] =
{
};
const unsigned int menu_1_6[1][16] =
{
{"6.點(diǎn)畫圖形 "},
};
const unsigned int menu_1_7[4][16] =
{
{" 液晶演示程序 "},
{" Version 1.0 "},
{" 制作人: 虎子 "},
{" 按enter:返回 "}
};
const unsigned int menu_1_end[]={}; //此項(xiàng)用于計(jì)算用
//菜單字符數(shù)組
const unsigned int *menu_level1_address_array[]= {
(unsigned int*)menu_1_0,(unsigned int*)menu_1_1,(unsigned int*)menu_1_2,(unsigned int*)menu_1_3,
(unsigned int*)menu_1_4,(unsigned int*)menu_1_5,(unsigned int*)menu_1_6,(unsigned int*)menu_1_7,
(unsigned int*)menu_1_end
};
//菜單處理函數(shù),與菜單字符數(shù)組一一對應(yīng)
const menu_function menu_level1_dispose_array[]={
menu_1_0_fun,menu_1_1_fun,menu_1_2_fun,menu_1_3_fun,
menu_1_4_fun,menu_1_5_fun,menu_1_6_fun,
menu_1_7_fun
//下一級菜單入口函數(shù)
};
//-------------以下是菜單處理函數(shù)-------------------------------
void menu_1_0_fun(void)//本級菜單初始化
{
menu_init((unsigned int *)hand_bmp1);
menu_addr_array=(unsigned int **)menu_level1_address_array;
menu_dispose_array=(menu_function *)menu_level1_dispose_array;
menu_list_display();
while(1)
{
*P_Watchdog_Clear = C_WDTCLR;
switch(Key_Get())
{
case KEY_1://enter press
menu_chg_windows(); //本級菜單窗口切換
break;
case KEY_2://+ key press
menu_down_roll();
break;
case KEY_3://- key press
menu_up_roll();
break;
}
}
}
void menu_1_1_fun(void)
{
LCD_disp_string(8,(unsigned int *)"lcd 顯示字符");
while (1) {
switch(Key_Get())
{
case 1: //press enter
return;
case 2://+ key press
break;
case 4://- key press
break;
}//switch end
LCD_disp_char(24,TimeBase128); //顯示一個漢字字符
*P_Watchdog_Clear = C_WDTCLR;
}//while end
}
void menu_1_2_fun(void)
{
unsigned int tmp=0;
while (1) {
*P_Watchdog_Clear = C_WDTCLR;
switch(Key_Get())
{
case 1:
return;
break;
case 2://+ key press
LCD_Set_Mask_bit(tmp++);
LCD_disp_string(8,(unsigned int *)" ");
LCD_disp_string(24,(unsigned int *)" ");
break;
case 4://- key press
LCD_Set_Mask_bit(tmp--);
LCD_disp_string(8,(unsigned int *)" ");
LCD_disp_string(24,(unsigned int *)" ");
break;
}//switch end
//十進(jìn)制顯示無符號整數(shù)數(shù)值
LCD_disp_dec_uint(8,TimeBase128);
//十六進(jìn)制顯示整數(shù)數(shù)值
LCD_disp_hex_uint(11,TimeBase128);
//十進(jìn)制顯示有符號整數(shù)數(shù)值
LCD_disp_dec_int(13,(int)TimeBase128);
//十六進(jìn)制顯示32位整數(shù)數(shù)值
LCD_disp_hex_lint(24,(unsigned long int)TimeBase128);
}//while end
}
unsigned int flag=1;
void menu_1_3_fun(void)
{
if (flag)
{
LCD_Cursor_Blink_ON();
flag=0;
}
else
{
LCD_Cursor_Blink_OFF();
flag=1;
}
}
void menu_1_4_fun(void)
{
unsigned int x=0,y=32;
LCD_disp_word_picture(x,y,(unsigned int *)encoding_000);
while (1) {
*P_Watchdog_Clear = C_WDTCLR;
switch(Key_Get())
{
case 1:
LCD_disp_word_picture(x,y,(unsigned int *)encoding_001);
return;
case 2://+ key press
LCD_disp_word_picture(x,y,(unsigned int *)encoding_001);
x+=16;
LCD_disp_word_picture(x,y,(unsigned int *)encoding_000);
break;
case 4://- key press
LCD_disp_word_picture(x,y,(unsigned int *)encoding_001);
y+=1;
LCD_disp_word_picture(x,y,(unsigned int *)encoding_000);
break;
default:
break;
}//switch end
}//while end
}
void menu_1_5_fun(void)
{
unsigned int time=TimeBase128;
while (TimeBase128<time+5*128) //持續(xù)5秒鐘
{
LCD_disp_full_screen((unsigned int *)encoding_02);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_03);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_04);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_05);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_06);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_07);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_08);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_00);*P_Watchdog_Clear = C_WDTCLR;
LCD_disp_full_screen((unsigned int *)encoding_01);*P_Watchdog_Clear = C_WDTCLR;
}
LCD_clear_screen(); //清屏
}
void menu_1_6_fun(void)
{
LCD_disp_string(8,(unsigned int *)"此版本不支持..");
*P_Watchdog_Clear = C_WDTCLR;
while(Key_Get()!=1);
return;
}
void menu_1_7_fun(void)
{
*P_Watchdog_Clear = C_WDTCLR;
while(Key_Get()!=1);
return;
}
最新資訊
- 2024-07-05 高亮液晶屏在工業(yè)和航空領(lǐng)域的應(yīng)用
- 2024-07-05 低溫環(huán)境下工業(yè)液晶屏的性能差異分
- 2024-06-25 立煌的LH0255ZJ01條形屏的相關(guān)介紹
- 2024-06-14 高溫對工業(yè)液晶顯示屏封裝材料的影
- 2024-06-12 京東方MV238FHB-NG0的簡介
- 2024-06-12 深入探討寬屏分辨率的工作原理
- 2024-06-12 深入探討寬屏分辨率的工作原理
- 2024-06-06 如何選擇適合自己的寬屏觸摸屏產(chǎn)品
- 2024-06-06 極端環(huán)境挑戰(zhàn)下超寬溫液晶屏的應(yīng)用
- 2024-06-05 條形屏是如何根據(jù)客戶的需求來進(jìn)行