View Single Post
  #12   Spotlight this post!  
Unread 12-07-2005, 16:58
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Measuring a Pulse Width

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
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org