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

{

                    if(!(GPIO_ReadInputDataBit(GPIOD,GPIO_Pin_0)))

                    {
                    uint16_t Default = 0x0000;                              //
                    uint16_t Compare = GPIO_ReadInputData(GPIOF) & 0x07ff; //Just Extract Under
            11bits

                    uint16_t Send = (Default | Compare);                               //DaeIp

                    if(Send!=pstat)
                       //if not match now's state and previous state
                    {
                            USART1_SendByte('C');
            //Send C to Pi to inform Sending Cds's Data to Pi

                            USART1_SendByte(Send);
              //Send under 8bits

                            USART1_SendByte(Send/256);
            //Send upper 3bits


                    }

                    Cdsstat = Send;
                                            //Save Stat to variables

                    }
                    else
                    {}                                                  //if not night no function

            }



            void FL(unsigned char d)
            {

                            switch(d)

                            {
                                    case '0':
                                            CPL;

                                            break;

                                    case '1':
                                            CHL;




                                                         -  188  -
   190   191   192   193   194   195   196   197   198   199   200