<< Click to Display Table of Contents >> Ultrasonic sensor |
|
Demo File: stm32f4_hcsr04_ultrasonic_sensor_demo.mdl
The demo showing how to use PWM capture to capture the pulse echo from Ultrasonic sensor. Convert the captured value +Width to unit of micro-seconds, then divide by 58 to get distant in unit of centimeters (Cm). The output result show on LCD and also send out via UART.
1. aMG F4Connect + aMG CLCD 2
2. aMG USB Converter N (Optional, to receive output data via UART.
Note: Make sure the selected pin for Trigger Output and PWM Input is 5V tolerant.
1. Testing result displayed on LCD
2. Testing result displayed on COM port.