Measure time between rising edges of 2 different inputs | Cypress Semiconductor
Measure time between rising edges of 2 different inputs
I am trying to use the common HC-SR04 Ultrasonic Sensor. Calculating the distance involves dividing the time between sending the trigger signal and recieving the echo signal by a constant (depending on units). To start I want the trigger pulse (10 us) to be sent via button press, and then software to take over and spit out the distance by LED code (different colors for different ranges).
I haven't yet tackled the LED portion yet, so help on that would be nice as well.
I tried to modify an example that measured time bewteen rising edges of the same input, but feel I did more damage than good. I am very new to PSoC programming and help is much appreciated.