Quote:
|
Originally Posted by MikeDubreuil
For some background, I am attempting to write software for the Parallax Inc. PING))) sonar sensor. The pulse width of it's response corresponds to the distance between itself and an object.
|
You should be able to do this with the EDU-RC by using a timer and interrupt one or two to determine the delay. These signals can also be configured to be a digital output, which will come in handy when you need to strobe the SIG pin. A more elegant solution would employ the built-in CCP hardware to calculate the time delta automatically. You might consider looking at the IR receiver code from 2004, which uses the aforementioned interrupt method to bin the incoming IR sensor pulses. For an (unpublished) example of how to use the CCP hardware, have a look at accel.c in this zip file:
http://kevin.org/frc/edu_accel_lcd.zip.
-Kevin