The description and photos below show how to set up a project that combines two sensors.
4.MX setting
GPIO
TIM3
ADC setup
ADC
-NVIC
TIM2 ADC1/2/3 USART3 Interrupt Enabled.
5.ADC calculate
ADC value - To calculate the distance, the equation was calculated by actually measuring based on the graph shown in the data sheet and saving it in an Excel table.
Details: 1.Target board: STM32F429ZI 2.Hardware setting (GP2Y0A21)
3.Hardware setting (HC-SR04)
The description and photos below show how to set up a project that combines two sensors.
4.MX setting
-NVIC
TIM2 ADC1/2/3 USART3 Interrupt Enabled.
5.ADC calculate ADC value - To calculate the distance, the equation was calculated by actually measuring based on the graph shown in the data sheet and saving it in an Excel table.