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

else  if(data1=='4'){  //4단계  상품출력
                                            GPIO_SetBits(GPIOD,  GPIO_Pin_11);  //128에  인터럽트  걸어줌
                                            Delay(0xffff);
                                            GPIO_ResetBits(GPIOD,  GPIO_Pin_11);
                                            //2번  L298  DC모터-2  동작
                                            GPIO_SetBits(GPIOD,  GPIO_Pin_6);    //  IN3=>H
                                            GPIO_ResetBits(GPIOD,  GPIO_Pin_7);    //  IN4=>L
                                            for(i=0;i<100;i++)  Delay(720000);
                                            GPIO_ResetBits(GPIOD,  GPIO_Pin_6);     //정지
                                            check  =  0;
                                    }
                    else  if(data1=='a')  //a를  라즈베리파이에서  받으면  게임중단
                                            check  =  0;
            }

            void  Usart2_rfid()
            {
                    usart_tag[usart_cursor][record_tag]=USART2->DR;//2차원  배열.  tag  [10]
                            if(record_tag==7  &&  usart_tag[usart_cursor][0]=='C'&&check==0)
                               {
                                    check=1;
                                    LCD  (line4,"Start  the  game!","__");
                                    USART1_SendByte('a');    //a를  라즈베리파이에  보내면  게임시작
                               }
                            record_tag++;
                            if(record_tag>7){
                                            record_tag=0;
                                    }
            }


            void  USART1_IRQHandler(void)
            {
                    if(USART_GetITStatus(USART1,  USART_IT_RXNE)  !=RESET)
                    {
                            Usart1_rasp();
                            USART_ClearITPendingBit(USART1,  USART_IT_RXNE);
                    }
            }


            void  USART2_IRQHandler(void)           //rfid로  값을  받으면  라즈베리파이에  시작신호  전송
            {




                                                         -  713  -
   715   716   717   718   719   720   721   722   723   724   725