| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 982 人关注过本帖
标题:求老鸟大佬们“分钟算法”几句的语句如何理解a=a
只看楼主 加入收藏
Davis_chen
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2020-11-3
收藏
 问题点数:0 回复次数:0 
求老鸟大佬们“分钟算法”几句的语句如何理解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;
        }
    }   
}
搜索更多相关主题的帖子: 算法 Show case break 语句 
2020-11-03 08:40
快速回复:求老鸟大佬们“分钟算法”几句的语句如何理解a=a
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024941 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved