求老鸟大佬们“分钟算法”几句的语句如何理解a=a
void main(void){
uchar a,b,c,d,e,f;
uint g;
uchar j;
uchar code dot[]={":"};
Init_lcd(); //LCD3õê¼»ˉ
set_time1();//ê±Öóé趨 //set_time1()3õê¼»ˉ1302
while(1)
{
get_time1(); //¶áè¡DS1302Äú2¿¼Ä′æÆ÷μÄêy¾Y
for(j=0;j<7;j++)
{
clk_list[j]=clk_time[j];
delayds1302(10);
}
a=clk_list[0]&0x0f; //¼ÆËãÃëÖó
clk_list[0]=(clk_list[0]>>4)&0x07;//CLK_LIST[0] MOVE RIGHT 4 BYTE COMPARE WITH 0X07 &
a=a+clk_list[0]*10;
b=clk_list[1]&0x0f; //¼ÆËã·ÖÖó
clk_list[1]=(clk_list[1]>>4)&0x07;
b=b+clk_list[1]*10;
c=clk_list[2]&0x0f; //¼ÆËãD¡ê±
clk_list[2]=(clk_list[2]>>4)&0x03;
c=c+clk_list[2]*10;
d=clk_list[3]&0x0f; //¼ÆËãèÕ
clk_list[3]=(clk_list[3]>>4)&0x03;
d=d+clk_list[3]*10;
e=clk_list[4]&0x0f; //¼ÆËãÔÂ
clk_list[4]=(clk_list[4]>>4)&0x01;
e=e+clk_list[4]*10;
g=clk_list[6]&0x0f; //¼ÆËãÄê
clk_list[6]=(clk_list[6]>>4)&0x0f;
g=g+clk_list[6]*10;
f=clk_list[5]&0x07; //¼ÆËãàñ°YDÇÆú
//ÏÔê¾ê±·ÖÃë
Show(0xc0,3,"Tim");
Show_two(0xc4,c); //ê±
Show(0xc6,1,dot); //·ûoÅ
Show_two(0xc7,b); //·Ö
Show(0xc9,1,dot); //·ûoÅ
Show_two(0xcA,a); //Ãë
//ÏÔê¾ÄêÔÂèÕ
Show(0x80,3,"Day");
Show(0x84,2,"20");
Show_two(0x86,g); //Ãà»ˉêy¾Y±ßÔμ
Show(0x88,1,".");
Show_two(0x89,e);
Show(0x8b,1,".");
Show_two(0x8c,d);
switch(f)
{
case 1:Show(0xCD,3,"Mon");break;
case 2:Show(0xCD,3,"Tue");break;
case 3:Show(0xCD,3,"Wed");break;
case 4:Show(0xCD,3,"Thu");break;
case 5:Show(0xCD,3,"Fri");break;
case 6:Show(0xCD,3,"Sat");break;
case 7:Show(0xCD,3,"Sun");break;
default:break;
}
}
}