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

void SC(void)

            {

                                    unsigned char tmp='0'+Stop;
                                    //convert int to char to send Data to Pi
                                    if(GPIO_ReadInputDataBit(GPIOD,GPIO_Pin_7))

                                    // if first Switch checked

                                    {
                                            SCM1=1;
                            // Enable Counter
                                            GLCD_displayStringLn(Line6, "Car1 Detected");

                                            Scount1 =0;
                                    // Clear Counter

                                            flag1 = 0;
                                    // Clear flag to Edge
                                    }
                                    if(GPIO_ReadInputDataBit(GPIOD,GPIO_Pin_8))

                                    {

                                            SCM1=0;
                            // Disable Counter
                                            if(flag1)
                                            // if this Switch pushed multiply
                                            {}
                                            // exit function

                                            else{
                                    // if this switch pushed firstly

                                            InttoChar(((uint16_t)48*100)/((uint16_t)Scount1),1);
                                    //Calculating Speed using Distance and Time
                                            USART1Write(CardDataBox,CardIDSize+1);
                                                            //Sending Car's Rfid information
                                            USART1Write(itc1,5);


            //Sending Car's Speed

                                            USART1_SendByte(tmp);


            //Sending Stopbit





                                                         -  186  -
   188   189   190   191   192   193   194   195   196   197   198