Page 97 - MDP2020-2
P. 97

················································································  명장양성프로젝트  【MDP】  과제발표회  자료집  Ⅱ    |  91



            void  loop(void)  {

                    Sec=millis();

                    if(millis()-timeVal>=1000){  //1초  단위  출력
                        readTime  =  millis()/1000;

                        if(millis()>=86400000){
                            timer0_millis=0;
                        }
                        timeVal  =  millis();

                        Sec  =  readTime%60;
                        Min  =  (readTime/60)%60;
                        Hour  =  (readTime/(60*60))%24;
                    }
            }//End  loop
            //***************************************************************************


            //***************************************************************************
            void  display_month(void)  {
                if(month==1)  u8g.drawStr(60,  20,  "/01");
                else  if(month==2)  u8g.drawStr(60,  20,  "/02");
                else  if(month==3)  u8g.drawStr(60,  20,  "/03");
                else  if(month==4)  u8g.drawStr(60,  20,  "/04");
                else  if(month==5)  u8g.drawStr(60,  20,  "/05");

                else  if(month==6)  u8g.drawStr(60,  20,  "/06");
                else  if(month==7)  u8g.drawStr(60,  20,  "/07");
                else  if(month==8)  u8g.drawStr(60,  20,  "/08");
                else  if(month==9)  u8g.drawStr(60,  20,  "/09");
                else  if(month==10)  u8g.drawStr(60,  20,  "/10");
                else  if(month==11)  u8g.drawStr(60,  20,  "/11");
                else  if(month==12)  u8g.drawStr(60,  20,  "/12");
            }


            void  display_day(void)  {
                if(day==1)  u8g.drawStr(78,  20,  "/01");
                else  if(day==2)  u8g.drawStr(78,  20,  "/02");
                else  if(day==3)  u8g.drawStr(78,  20,  "/03");
                else  if(day==4)  u8g.drawStr(78,  20,  "/04");
                else  if(day==5)  u8g.drawStr(78,  20,  "/05");
                else  if(day==6)  u8g.drawStr(78,  20,  "/06");
                else  if(day==7)  u8g.drawStr(78,  20,  "/07");
                else  if(day==8)  u8g.drawStr(78,  20,  "/08");
                else  if(day==9)  u8g.drawStr(78,  20,  "/09");
   92   93   94   95   96   97   98   99   100   101   102