基于单片机的课程设计
year=0; month=1;
count=((init[5]&0xf0)>>4)*10+
(init[5]&0x0f); //读当前星期数据 }
while(week) //设定星期 {
key_set(7,1,14); if(!K3) {
count=((init[2]&0xf0)>>4)*10+
delay1(80);
Set_W1302(0x8a); week=0; hour=1;
}
count=((init[4]&0xf0)>>4)*10+(init[4]&0x0f); //读当前月数据 }
while(month) //设定月 {
key_set(12,1,7);
if(!K3) {
delay1(80);
Set_W1302(0x88); month=0; day=1;
}
Set_place(1,14);
Set_place(1,7);
(init[2]&0x0f); //读当前时数据 }
while(hour) //设定时 {
key_set(23,2,5);
if(!K3) {
delay1(80);
Set_W1302(0x84); hour=0; min=1;
}
count=((init[3]&0xf0)>>4)*10+(init[3]&0x0f); //读当前日数据 }
while(day) //设定日 {
key_set(31,1,10); if(!K3) {
delay1(80);
Set_W1302(0x86); day=0; week=1;
}
Set_place(2,5);
count=((init[1]&0xf0)>>4)*10+(init[1]&0x0f); //读当前分数据 }
Set_place(1,10);