Page 134 - 2
P. 134

}
                    if(rx==0x02){
                    Rightturn();
                    rx=7;
                    }
                    if(rx==0x03){
                    Leftturn();
                    rx=7;
                    }
                    if(rx==0x04){
                    Stop();
                    rx=7;
                    }
                    if(rx==0x05){
                     Gun();
                     rx=7;
                    }
                }
            }
            interrupt [EXT_INT4] void external_int4(void)//KSM 센서
            {
                shot--;
                PORTB=shot;
                delay_ms(500);
                if(shot==0){
                Shutdown();
            }
                EIFR = 0xff;
            }
            interrupt [EXT_INT5] void external_int5(void)// 리드센서
            {
                PORTB = 0x00;
                Shutdown();
            }
            interrupt [USART0_RXC] void RX_interrupt(void)//  수신 인터럽트
            {
                rx = UDR0;         //  수신된 데이터가 저장된 UDR0           송수신 데이터 레지스터를 rx           에 대입
            }
















                                                         - 134 -
   129   130   131   132   133   134   135   136   137   138   139