Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHC-SR04 (ultrasonic sensor) verilog code help
Hi, for my project i have to interface the HC-SR04 (ultrasonic sensor) to my DE2-115 board. I have been struggling with the verilog code for a while. Can anyone please help me out with the code? T...
Altera_Forum
Honored Contributor
11 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.