Page 220 - MDP2022-2
P. 220

/*  USER  CODE  BEGIN  1  */


                /*  USER  CODE  END  1  */



                /*  MCU  Configuration----------------------------------------------------
            ----*/


                /*  Reset  of  all  peripherals,  Initializes  the  Flash  interface  and  the  Systick.  */
                HAL_Init();



                /*  USER  CODE  BEGIN  Init  */


                /*  USER  CODE  END  Init  */


                /*  Configure  the  system  clock  */

                SystemClock_Config();


                /*  USER  CODE  BEGIN  SysInit  */



                /*  USER  CODE  END  SysInit  */


                /*  Initialize  all  configured  peripherals  */
                MX_GPIO_Init();
                MX_USART2_UART_Init();
                /*  USER  CODE  BEGIN  2  */

                /*  USER  CODE  END  2  */


                /*  Infinite  loop  */
                /*  USER  CODE  BEGIN  WHILE  */

                while  (1)
                {
                    /*  USER  CODE  END  WHILE  */


                    /*  USER  CODE  BEGIN  3  */
                            if(HAL_UART_Receive(&huart2,  &a,  1,  1000)  ==  HAL_OK)  {


                                    /*if(HAL_GPIO_ReadPin(GPIOD,GPIO_PIN_14))
                                    {



                                    }*/
                                    if(a  ==  '1')  {
   215   216   217   218   219   220   221   222   223   224   225