技術(shù)知識(shí)
您只需一個(gè)電話我們將推薦性價(jià)比高的液晶屏產(chǎn)品選型,讓您花合理的價(jià)格,達(dá)到預(yù)期的效果
- 全國統(tǒng)一服務(wù)熱線
- 15382323032
產(chǎn)品動(dòng)態(tài)
- G270QAN01.4 友達(dá)27寸 400 cd/m2 分辨率25
- G190ETT01.1 友達(dá)19寸 分辨率1280*1024 常白
- 18.5寸G185HAT01.1 友達(dá) 對(duì)比度1000:1 分辨
- 友達(dá)G101EAT02.6 10.1寸 分辨率1280*800 對(duì)比
- G156HAN02.303 友達(dá)15.6寸 對(duì)比度1000:1 霧面
- G057QAN01.1 友達(dá)5.7寸 常黑顯示 1000:1 分
- G238HAN04.0 友達(dá)23.8寸 常黑顯示 分辨率
- 友達(dá)8.4寸 G084SAN01.0 常黑顯示 分辨率
- G057QAN01.0 友達(dá) 5.7寸 500 cd/m2 常黑顯示
- G057QAN01.0 友達(dá) 5.7寸 500 cd/m2 常黑顯示

全國統(tǒng)一服務(wù)熱線:
15382323032
客服QQ:3234659108
手機(jī):15382323032
地址:浙江省杭州市余杭區(qū)五常街道西溪軟件園金牛座B2座4層4118-4119
12864液晶屏如何去做多級(jí)菜單?
現(xiàn)在很多的工程師在使用12864液晶屏?xí)r,都會(huì)碰到應(yīng)該如何做多級(jí)菜單的問題,去請(qǐng)教供應(yīng)商吧,往往是得不到想要的答案的,去問百度吧,又不能夠確定答案是否正確,難!今天,我們就請(qǐng)杭州精顯的工程師來給您一個(gè)12864液晶屏如何做多級(jí)菜單的范例。
#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] = //一級(jí)菜單
{
{"1.字符顯示演示 "},
{"2.數(shù)據(jù)顯示演示 "},
{"3.光標(biāo)閃爍開關(guān) "},
{"4.圖形顯示演示 "},
{"5.動(dòng)畫演示 "},
{"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ù)組一一對(duì)應(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
//下一級(jí)菜單入口函數(shù)
};
//-------------以下是菜單處理函數(shù)-------------------------------
void menu_1_0_fun(void)//本級(jí)菜單初始化
{
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(); //本級(jí)菜單窗口切換
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); //顯示一個(gè)漢字字符
*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)制顯示無符號(hào)整數(shù)數(shù)值
LCD_disp_dec_uint(8,TimeBase128);
//十六進(jìn)制顯示整數(shù)數(shù)值
LCD_disp_hex_uint(11,TimeBase128);
//十進(jìn)制顯示有符號(hào)整數(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;
}
最新資訊
- 2025-03-05 關(guān)于工業(yè)液晶屏寬溫操作的介紹
- 2025-03-03 關(guān)于工業(yè)液晶屏觸摸技術(shù)的分析
- 2025-02-27 工業(yè)液晶屏高分辨率的優(yōu)勢(shì)與應(yīng)用
- 2025-02-25 高亮液晶屏在惡劣光照條件下的穩(wěn)定
- 2025-02-21 工業(yè)液晶屏的定制化需求
- 2025-02-12 工業(yè)液晶屏的響應(yīng)時(shí)間與動(dòng)態(tài)顯示性
- 2025-02-10 工業(yè)液晶屏的接口類型及其兼容性分
- 2025-02-08 如何從參數(shù)到性能讀懂工業(yè)液晶屏的
- 2025-02-06 工業(yè)液晶屏的切割技術(shù)是探索屏幕制
- 2025-01-21 工業(yè)液晶屏之高分辨率LCD屏的深度解