On Sun, 17 Mar 2002, Duane B wrote: > I using the CCS compiler. I gotten the sonar unit out of the camera, and > applied the mod (3-cuts, 2-wires) the most of the web sites say I need. > This is the one that has the PCB with the connector at a 45 degree angle on > one side. Some web sites have a somewhat complex circuit as in interface > (http://www.robotprojects.com/sonar/sonarprj1.htm) and some have a simple > interface (http://www.seattlerobotics.org/encoder/200010/dlcsonar.html). I > want to start with one, then will eventually multiplex 5 or so more > together. I haven't found any code in "C" on the web. But, I have found > lots of asy code. I see... well, for the one project I have that uses a Polaroid unit, I have a TIMER0 interrupt (#int_rtcc) set up for 900uS interrupts to increment a global char range variable. I clear the range variable and TIMER0, fire the sonar, and wait for either a timeout or an echo signal. If I get an echo signal, the range var holds the range in feet, times two (round trip for the ping). After that, wait until 80ms has elapsed before firing the sonar again. With the sonar unit I have (not from a camera, but same type more or less) I can get accurate ranging out to about 36' or so. Just be aware you may see a lot of echoes depending on where you are. Dale -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu