{
measure_menu[0].menu_count=2; measure_menu[0].display=qr;
//开始测量函数, 确认.
measure_menu[0].subs=start_measure_function; //开始测量函数 measure_menu[0].children_menus=NULL; measure_menu[0].parent_menus=main1_menu; measure_menu[1].menu_count=2; measure_menu[1].display=qx;
//开始测量函数, 取消.
measure_menu[1].subs=NULL;
measure_menu[1].children_menus=NULL; }
?? //还有void store_menu_initial()、void time_menu_initial()// void led_menu_pro() {
max_item=menu_led->menu_count; switch(keyval) {
case 0: break; case 1: }
?? //“向上”“向下”“确认”“取消”键// if(shuaxin)
measure_menu[1].parent_menus=main1_menu;
//向上键.
if(user_choosen==0) { }
shuaxin=1; user_choosen--; break;
user_choosen=max_item;
//是否需要刷新LCD标志位.
{ Clr_Scr();
shuaxin=0;
} }
v oid led_menu_show() { //
break;
uchar n;
max_item=menu_led->menu_count; if (max_item>=4) { } else {
switch(temp_choosen) { case 0:
draw_bmp(0,20,96,0,measurearray); //“开始测量”数组
//菜单项为3则表示为主菜单.
led_menu_show();
for(n=0;n<4;n++)
{ draw_bmp(n*2,20,96,0,menu_led[n].display); }
select_item(user_choosen);
//标记出当前菜单项.
??
default:
}
for(n=0;n select_item(user_choosen+1); } } draw_bmp((n+1)*2,20,32,0,menu_led[n].display); break; void select_item(uchar n) { draw_bmp(n*2,2,16,0,curflag); } void start_measure_function(void) //开始测量函数// {main_Menu(); } ?? /*----------------主函数-------------------*/ main() { init_cpu(); Init_Clock(); init_lcd(); Disp_Img(FirstPage); delay(2000); //延时// ClockMsg(); Refresh(); delay(2500); Clr_Scr(); main_Menu(); Clr_Scr(); main_menu_initial(); measure_menu_initial(); store_menu_initial(); time_menu_initial(); communication_menu_initial(); while(1) //读键. { keyval=get_key(); led_menu_pro(); } } // 适当延时防止因为不断查忙而耗费大量CUP资源 // 附录三 ADC0832程序 #define uint unsigned int //常量/变量定义// uchar k,i,j; float xdata lv; sbit ADCS =P3^1; //ADC0832 chip seclect //接口定义// ?? //其它引脚略?? uchar xdata dsw[20]; //存放sprintf转换字符 uchar xdata value[149]; //点阵字符储存 uchar code table[]={ //字符查表 0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*\??};//采集并返回 unsigned int Adc0832(unsigned char channel) //AD转换,返回结果 { uchar i=0; uchar j; uint dat=0; uchar ndat=0; if(channel==0)channel=2; if(channel==1)channel=3; ADDI=1; _nop_(); _nop_(); ADCS=0;//拉低CS端 _nop_(); _nop_(); ADCLK=1;//拉高CLK端 _nop_(); _nop_(); ADCLK=0;//拉低CLK端,形成下降沿1