Thread: Ultrasonic
View Single Post
  #2   Spotlight this post!  
Unread 09-02-2008, 23:02
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Ultrasonic

You can wire it two 2 ports from that one set of 3. I wrote some code for that sensor and it works if one of the pins is in port 1 or 2. I am working now to get ports 3-6 working, but with no luck.
Basically what you have to do is send a pulse on a digital output (set one of them to 1 for a couple of seconds) then you wait for an input, which is where you use an interrupt and a timer to time the pulse. Take a look at the datasheet for that sensor
http://www.parallax.com/Portals/0/Do...-PING-v1.4.pdf

and if you would like I could upload my code that works with ports 1&2.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -