Page 539 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 539

flag=0;
                  motor=0;

               }
               else if (op=='b')

               {
                  flag_ir=1;
                  motor=0x02;

               }
               else;

            }

            interrupt [EXT_INT3] void sensor(void)     //센서 flag

            {
               flag=1;

               motor=0x01;
            }



            interrupt [TIM0_OVF] void ovf0(void)
            {

               time++;


               if (time%122==0)

               {
                  if (flag&&flag_ir)

                  {
                     if (time==122) motor=0x01;
                     else if (time==244) motor=0x0a;

                     else if (time==366)
                     {

                        motor=0x02;
                        flag=0;
                     }

                  }
                  if (time==366) time=0;





                                                         -  532  -
   534   535   536   537   538   539   540   541   542   543   544