I would like to read a TIMER immediately after sending a trigger pulse to my SONARS. Then immediately reset it for the next cycle. (Which TIMER am I not using with PAUSE or HPWM.) Anybody?
I want to calculate velocity. I plan to subtract two SONAR distance readings and divide by the time elapse between triggers. Units of distance sound travels in a millisecond (13.2 inches) divided by the number of milliseconds. (Could do no translation: Use the distance sound travels in a 4Mhz tick divided by the number of those ticks between SONAR triggers.) Could I explain that to middle school students?
I have not been translating SONAR echo pulses to inches. Instead I learned how to translate inches into SONAR echo times. That is how I set up my distance parameters. At 1100 feet per second that is 13.2 inches per millisecond. (When measuring distance the PIC must divide by two. It is measuring time for an echo response.)
Any simple code snippets you know of?
Ken
Bookmarks