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

PORTB = 0xff;
                 TCCR0  =  0x07;
                 k=1;
                 UDR0  =  'm';
                 }
            }


            interrupt [USART0_RXC] void  RX_interrupt(void)
            {
                 Temp = UDR0;
            }
            interrupt [TIM0_OVF] void timer_int0(void)
            {
                 t++;
                 if(t  == 61  && k==0)
                 {
                       PORTC &= 0x01;
                       t = 0;
                       TCCR0 = 0x00;
                 }
                 if(t  == 180  && k==1)
                 {
                       PORTB = 0x00;
                       t = 0;
                       TCCR0 = 0x00;
                 }
            }


            void  PORT()
            {
                 DDRA  =  0xff;
                 DDRD = 0x00;
                 DDRE  =  0xf0;
                 DDRG = 0xff; //led
                 DDRB = 0xff;  //led   speak
                 DDRC  =  0xff; //motor
            }


            void  UCS()
            {
                 UCSR0A = 0x00;




                                                         -  38  -
   40   41   42   43   44   45   46   47   48   49   50