Forum Discussion
Altera_Forum
Honored Contributor
10 years agoHi Mao,
Base on the HC-SR04 (ultrasonic sensor) timing diagram the control signal is trig and echo pulse width. I could suggest you design a state machine to generate the trig pulse with counter. Use the Echo trig to calculate the pulse and cover to distance.