/*==============设置闹钟================*/
shen://设置闹钟
wanbiao=0;
TR1=1; //开光标
writecommand(0x01);//清屏
while(1)
{
display(1,1,"设置闹钟");
display(4,1,"闹铃:");
display(3,4,":");
key_1=10;
keychuli();
if(keyz==0x24) {TR1=0;goto miaob;}//上下翻页
if(keyz==0x28) {TR1=0;goto sher;}
if(keyz==0x48){wanbiao++;if(wanbiao>3)wanbiao=0;}// 选择调整对象
if(keyz==0x18){wanbiao--;if(wanbiao<0)wanbiao=3;}//
//修改闹铃时间
if(key_1!=10)
{
switch(wanbiao)
{
case 0: wanbiao++;if(wanbiao>3)wanbiao=0;naoling[0]=key_1;break;//时十
case 1: wanbiao++;if(wanbiao>3)wanbiao=0;naoling[1]=key_1;break;//时个
case 2: wanbiao++;if(wanbiao>3)wanbiao=0;naoling[2]=key_1;break;//分十
case 3: wanbiao++;if(wanbiao>3)wanbiao=0;naoling[3]=key_1;break;//分个
default:break;
}
}
//显示程序
writecommand(0x8a);
if(shand==1&&wanbiao==0) writedata(yejingtable[10]); //光标闪动
else writedata(yejingtable[naoling[0]]); //
if(shand==1&&wanbiao==1) writedata(yejingtable[10]);//光标闪动
else writedata(yejingtable[naoling[1]]);
writecommand(0x8c);
if(shand==1&&wanbiao==2) writedata(yejingtable[10]);
else writedata(yejingtable[naoling[2]]);
if(shand==1&&wanbiao==3) writedata(yejingtable[10]);
else writedata(yejingtable[naoling[3]]);
if(keyz==0x84) naol=~naol;
if(naol==1)display(4,4,"开");
else display(4,4,"关");
if(keyz==0x88) {TR1=0;goto ril;}//退回主菜单
}
/*==============设置日期================*/
sher://设置日期
TR1=1; //开光标
wanbiao=0;
writecommand(0x01);//清屏
while(1)
{
display(1,1,"设置日期");
display(3,1,"20");
display(3,3,"年");
display(3,6,"月");
display(3,8,"日");
display(4,1,"星期");
key_1=10;
keychuli();
if(keyz==0x48){wanbiao++;if(wanbiao>6)wanbiao=0;}
if(keyz==0x18){wanbiao--;if(wanbiao<0)wanbiao=6;}
if(keyz==0x24){TR1=0;goto shen;}//上下翻页
if(keyz==0x28){TR1=0;goto shes;}
if(key_1!=10)
{
switch(wanbiao)
{
case 0:wanbiao++;if(wanbiao>3)wanbiao=0;wandisplay[0]=key_1;break;//年十
case 1:wanbiao++;if(wanbiao>6)wanbiao=0;wandisplay[1]=key_1;break;//年个
case 2:wanbiao++;if(wanbiao>6)wanbiao=0;wandisplay[2]=key_1;break;//月十
case 3:wanbiao++;if(wanbiao>6)wanbiao=0;wandisplay[3]=key_1;break;//月个
case 4:wanbiao++;if(wanbiao>6)wanbiao=0;wandisplay[4]=key_1;break;//日十