AnsweredAssumed Answered

Problem with SRF05 and STM32F429

Question asked by Malayjerdi.Ehsan on Apr 17, 2017
Latest reply on Apr 17, 2017 by Clive One

Hi EveryOne

I have a problem with SRF05 and STM32F429 DISC

My code is

 while (1)
  {
  /* USER CODE END WHILE */
        float time;
        int i=0;
        float distance ;
  HAL_GPIO_WritePin(GPIOD,GPIO_PIN_10,GPIO_PIN_SET);
        HAL_Delay(120);
         HAL_GPIO_WritePin(GPIOD,GPIO_PIN_10,GPIO_PIN_RESET);
        while(HAL_GPIO_ReadPin(GPIOD,GPIO_PIN_11)==0);
        while(HAL_GPIO_ReadPin(GPIOD,GPIO_PIN_11)) i++;
        time=(float) i/9500000;
        distance=(time*344)*1000/2;
        HAL_Delay(1440000);
    

but always distance in 0;

please help for this problem

 


        
  /* USER CODE BEGIN 3 */

 

  }

Outcomes