一、单片机通用菜单程序
我师兄去年做过一个,只要你的RAM足够,可以无限级菜单,正好也是四个键,正好和你的一样.很好理解,我最近花一天时间移植成功过.他的lcd是不带字库的,不过没关系,只要重写一下lcd底层驱动就好.我用的是带字库的lcd LM3033.你给我个邮箱,或者在Hi上留言,写上你的邮箱.
二、有没有比较实用的菜谱软件?
比较实用的,你说的是香哈菜谱app吗?我知道的菜谱软件就只有这一个了
三、怎么用C语言编写菜单?
#include stdio.h
#include stdlib.h
#include dos.h
#include windows.h
char choice1;
void main()
{
void menue1();
printf(欢迎进入Ben的作业查询系统!);
menue1();
}
void menue1()
{
void choicemenue1();
printf(n请按照以下列表选择您想要查看的章节:);
printf(n编号t章节n 1t第一章n 2t第二章n);
printf(请输入编号进行选择:);
choicemenue1();
}
void choicemenue1()
{
choice1=getch();
switch(choice1)
{
void menuechapter1();
void menuechapter2();
void menue1();
case '1':menuechapter1();break;
case '2':menuechapter2();break;
default:printf(n输入错误!请重新选择!n),menue1();
}
}
void menuechapter1()
{
char choiceex;
printf(n您选择的是第%c章,choice1);
printf(n现在请选择本章节的题目。);
printf(n请按照以下列表选择题目:);
printf(n编号t题目编号n1t第1题n2t第2题n);
printf(请选择:);
switch(choiceex=getch())
{
void c1_1();
void c1_2();
case '1':c1_1();break;
case '2':c1_2();break;
default:
printf(n你个白痴!这也能选错!不让你重选了!);
printf(n按任意键以退出!);
getch();
exit(0);
}
}
void menuechapter2()
{
char choiceex;
printf(n您选择的是第%c章,choice1);
printf(n现在请选择本章节的题目。);
printf(n请按照以下列表选择题目:);
printf(n编号t题目编号n1t第1题n2t第2题n);
printf(n请选择:);
switch(choiceex=getch())
{
void c2_1();
void c2_2();
case '1':c2_1();break;
case '2':c2_2();break;
default:
printf(n你个白痴!这也能选错!不让你重选了!);
printf(n按任意键以退出!);
getch();
exit(0);
}
}
void c1_1()
{
char howtorun;
printf(现在请选择考察方式:);
printf(n编号t考察方式n 1t运行程序n 2t查看源代码n 3t返回主菜单n 4t退出程序n);
printf(请选择:);
switch(howtorun=getch())
{
void runc1_1();
void menue1();
case '1':runc1_1();break;
case '2':printf(n),system(type \caidan\chapter1\c1_1.c),printf(n),getch();break;
case '3':menue1();break;
case '4':exit(0);break;
default:
printf(程序即将结束!哈哈哈……);
printf(按任意键以结束程序!);
getch();
exit(0);
}
}
void c1_2()
{
printf(c1_2 is OK!);
}
void c2_1()
{
printf(c2_1 is OK!);
}
void c2_2()
{
printf(c2_2 is OK!);
}
void runc1_1()
{
int a,b,max;
printf(nPlease input two integer numbers:);
printf(a=?,b=?n);
scanf(%d,%d,&a,&b);
max=a>b?a:b;
printf(The max number is %d,max);
}
大概就是这样做的。。