Go to Post yes, we've gone over every possible idea multiple times. No, we're not going to stop. Welcome to FIRST. - logicalyrandom [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2008, 22:37
rie89 rie89 is offline
Registered User
FRC #2594 (NASKCO)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: nampa
Posts: 1
rie89 is an unknown quantity at this point
Ultrasonic

hey, i'm new to this, and i have just joined programming.... I was wondering if anone was using an ultrasonic rangefinder or if anyone knew how to write the code. I have a ultrasonic that has only 1 port... it's the Ping))) ultrasonic distance sensor from Parallax.... I was using WPILib, but that has both an echo and ping port, and mine has only a connection for one port, and the sample code is in basic, which I don't understand... HELP?! thanks oh, and I am working in C programming.
  #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: 325
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 -
  #3   Spotlight this post!  
Unread 10-02-2008, 16:24
Lucretius Lucretius is offline
#395 Mentor, #1884 Alumnus
FRC #0395 (2 Train Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: New York, NY
Posts: 42
Lucretius is an unknown quantity at this point
Re: Ultrasonic

The WPIlib code works if you use a Y-cable to plug the Ping))) into, say, ports 1 and 7 (the echo port must be one of the first 6). You'll have to convert the male ends of the Y-cable to female.
  #4   Spotlight this post!  
Unread 10-02-2008, 17:50
RKElectricalman's Avatar
RKElectricalman RKElectricalman is offline
Meezy the Mentor
AKA: Rameez
FRC #0384 (Sparky 384)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Richmond, Va
Posts: 88
RKElectricalman is just really niceRKElectricalman is just really niceRKElectricalman is just really niceRKElectricalman is just really nice
Send a message via AIM to RKElectricalman
Re: Ultrasonic

Will, I was wondering if you could upload your code so I can check it out as well?

I've been trying to get multiple sonars working and I just don't know how!

So if you can upload that'd be great, and if anyone else can upload code that they've used to get Multiple sonars working that'd be great! It would really help me and possibly many others!

- Rameez
__________________
ahhh Division Finalists!!
  #5   Spotlight this post!  
Unread 10-02-2008, 19:21
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Ultrasonic

I've previously posted my single pin ultrasonic driver.

I also have a quad ultrasonic driver that's not abstracted from the 1024 2008 robot code entirely (as my previous single pin single ultrasonic was). I'll be releasing my quad ultrasonic driver as early as after ship date or as late as mid season.

Just to give a few specs, my quad ultrasonic driver (usdriver2.c/h) can read up to four simultaneous measurements from four parallax PING))) (or similar) ultrasonic sensors. They can be fired together or in any combination or sequence at any time (provided the individual sensor is not busy). The system makes use of digital I/O pins 3-6 and is not reconfigureable to any other pins, and also uses TMR1. This, also, is not reconfigureable.

If there is enough interest in this driver i'll make it more of a priority.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #6   Spotlight this post!  
Unread 10-02-2008, 20:58
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: 325
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

My code for port 1 or 2:
www.easternfront.org/ultrasonic_port_1_2.zip

I have to get the ones for 3-6 working sometime soon, I cant seem to get it, I have a thread going about my problem here:
http://www.chiefdelphi.com/forums/sh...ad.php?t=63081
I shall look over your code Qbranch, thanks for posting

After the season when I have some time I will play around with using only 1 port (I had mixed results before)
__________________
Programming in LabVIEW? Try VI Snippets!

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

Last edited by wt200999 : 10-02-2008 at 21:02.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ultrasonic rangefinder code windell747 Programming 9 25-01-2008 00:37
Ultrasonic will not work with another Ultrasonic plz help Jackel148 Programming 10 10-05-2006 15:31
Ultrasonic Distances irishninja FIRST Tech Challenge 1 30-04-2006 20:25
Ultrasonic Sensor output Dillon Compton Programming 5 03-02-2006 10:20
Ultrasonic Sensor winners Programming 3 02-01-2006 20:55


All times are GMT -5. The time now is 19:13.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi