十一个按键,上一页 下一页 确认选择 取消选择 确认 ,剩下六个是对应显示屏的六个物品按哪个选哪个
制作出来的实物图如下:
点菜端一共 11个按键
左边的 5个按键是功能按键
上一页
选择 付 取消
下一页
右边的6个按键是菜品按键
菜品 1 菜品 2 菜品 3
菜品 4 菜品 5 菜品 6
开机的时候显示
点菜端系统
可通过按键更改桌号
当前桌号 【01】号
按【ok】确定
确定桌号后点
进入点菜环节
界面显示菜单 选取时在后面做好标记
附件包含点菜端和厨房端的程序和电路
单片机源程序如下:
#include "main.h"int t0_time,t0_time_5ms,t0_time_50ms; int price; unsigned char table_num=1,Dishes_num; short mod,set_f,menu_f; char menu_b[7],Uart_dat[9]; char code menu[7][13] = { {"鱼香肉丝 15 "},//1 {"番茄炒蛋 15 "}, {"红烧牛肉 30 "}, {"糖醋排骨 30 "}, {"清炒白菜 10 "}, {"紫菜蛋汤 10 "} }; void display() { char cose_temp[17] = 0; int i; switch (mod) { case 0: //在等待模式下显示 LCD12864_display_string(0,1," 后厨端系统 "); LCD12864_display_string(0,2,"暂无菜品...."); LCD12864_display_string(0,3," "); LCD12864_display_string(0,4," "); break; case 1 ://菜品信息界面 LCD12864_display_string(0,1,"桌号"); LCD12864_display_string(4,1,"总量"); cose_temp[0] = ':'; cose_temp[1] = table_num/10%10 + '0'; cose_temp[2] = table_num/1%10 + '0'; cose_temp[3] = ' '; cose_temp[4] = '\0'; LCD12864_display_string(2,1,cose_temp); cose_temp[1] = Dishes_num/10%10 + '0'; cose_temp[2] = Dishes_num/1%10 + '0'; LCD12864_display_string(6,1,cose_temp); if(Dishes_num<3) { for(i=0;i<Dishes_num;i++) { LCD12864_display_string(1,i+2,menu[menu_b[i]]); } LCD12864_display_string(0,4," ==没有了哦== "); } else { if(menu_f == 0) //显示第一页 { for(i=0;i<3;i++) { LCD12864_display_string(1,i+2,menu[menu_b[i]]); } } else //显示第二页 { for(i=3;i<Dishes_num;i++) { LCD12864_display_string(1,i-1,menu[menu_b[i]]); } if((Dishes_num-3)<3) LCD12864_display_string(0,Dishes_num-1," ==没有了哦== "); } } break; case 2: //结算界面 LCD12864_display_string(0,1,"桌号"); LCD12864_display_string(4,1,"总量"); cose_temp[0] = ':'; cose_temp[1] = table_num/10%10 + '0'; cose_temp[2] = table_num/1%10 + '0'; cose_temp[3] = ' '; cose_temp[4] = '\0'; LCD12864_display_string(2,1,cose_temp); cose_temp[1] = Dishes_num/10%10 + '0'; cose_temp[2] = Dishes_num/1%10 + '0'; LCD12864_display_string(6,1,cose_temp); LCD12864_display_string(0,3,"====出餐成功===="); LCD12864_display_string(0,4,"==等侯客户取餐=="); led = 0; while(cgq==0) { Motor(100,10,1); } led = 1; LCD12864_display_string(0,3,"====取餐成功===="); LCD12864_display_string(0,4,"==即将返回首页=="); Delay1ms(3000); mod = 0; break; } } void main() { init();//开机初始化 led = 1; ClrScreen();//清屏 LCD12864_display_string(0,1,"》》欢迎使用《《"); Delay1ms(500); LCD12864_display_string(0,2,"==智能点菜系统=="); Delay1ms(500); LCD12864_display_string(0,4,"姓名:某某某 "); Delay1ms(500); LCD12864_display_string(0,3,"1636100103"); Delay1ms(1000); ClrScreen(); //清除屏幕显示 while(1) { key_scan(); display(); } } void t0() interrupt 1 using 1 //这个是定时中断函数 { TL0 = 0x20; //设置定时初值 TH0 = 0xD1; //设置定时初值 t0_time++; if(5 == t0_time)//5ms { t0_time = 0; t0_time_5ms++; //======此处为5毫秒执行一次====== //================================ if(8 == t0_time_5ms) { t0_time_5ms = 0; t0_time_50ms++; //=====此处为50毫秒执行一次======= //================================ if(2 == t0_time_50ms) //此处为一秒进入一次 { t0_time_50ms = 0; } } } }
复制代码