Go to Post Don't forget the robot, the most important hardware there is!:p - artK [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 23-01-2006, 23:34
Dillon Compton Dillon Compton is offline
Jack-Of-All-Trades
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Malvern, PA
Posts: 186
Dillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud of
Send a message via AIM to Dillon Compton
Ultrasonic Sensor output

Hi All,
I'm going to post this here because we are coding in easyC this year, so i'd like a usable code snippet if someone posts one...

We're using ultrasonic sensors for our autonomous mode this year, and I was wondering what type of data they output. I assume that it is probably the standard PWM 0-255; if this is the case, what is the correlation between distance and value? If it is another type of output, what is it?

I suppose I could slap it on last years robot (or an old RC) and do some tests, but I figured I would run it by the experts 'round these parts first!

Thanks in advance for any help,
Dillon Compton.
__________________
www.metalmoose.com
  #2   Spotlight this post!  
Unread 24-01-2006, 08:12
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Ultrasonic Sensor output

Quote:
Originally Posted by Dillon Compton
Hi All,
I'm going to post this here because we are coding in easyC this year, so i'd like a usable code snippet if someone posts one...

We're using ultrasonic sensors for our autonomous mode this year, and I was wondering what type of data they output. I assume that it is probably the standard PWM 0-255; if this is the case, what is the correlation between distance and value? If it is another type of output, what is it?

I suppose I could slap it on last years robot (or an old RC) and do some tests, but I figured I would run it by the experts 'round these parts first!

Thanks in advance for any help,
Dillon Compton.
EasyC has a block built in for the VEX/Daventech ultrasonic sensor. The help file tells how to connect it. EasyC will return the distance in inches. The Ultrasonic sensor can be:
  • Started: the sensor starts pinging and computing the distance to the nearest object in its field of view.
  • Stopped: where the pinging is stopped
  • Get: where you read the most recent distance that it measured is returned to your program.
You use the same block for each of those operations. When you drag the block into the program select the option that you want. In the case of Get you need to supply a variable for the result.

The way it works (internally) is that one connection goes to a digital output and the other to an interrupt pin (digital inputs 1-6). The sensor is sent a pulse on the digital output that causes it to transmit a burst of ultrasonic sound. When the sound reflects off of an object, it returns and causes a signal on the digital input (interrupt) pin. EasyC computes the round trip time of the sound and converts that time to inches based on the speed of sound.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #3   Spotlight this post!  
Unread 24-01-2006, 12:23
Dillon Compton Dillon Compton is offline
Jack-Of-All-Trades
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Malvern, PA
Posts: 186
Dillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud of
Send a message via AIM to Dillon Compton
Re: Ultrasonic Sensor output

Quote:
Originally Posted by BradAMiller
EasyC has a block built in for the VEX/Daventech ultrasonic sensor. The help file tells how to connect it. EasyC will return the distance in inches. The Ultrasonic sensor can be:
  • Started: the sensor starts pinging and computing the distance to the nearest object in its field of view.
  • Stopped: where the pinging is stopped
  • Get: where you read the most recent distance that it measured is returned to your program.
You use the same block for each of those operations. When you drag the block into the program select the option that you want. In the case of Get you need to supply a variable for the result.

The way it works (internally) is that one connection goes to a digital output and the other to an interrupt pin (digital inputs 1-6). The sensor is sent a pulse on the digital output that causes it to transmit a burst of ultrasonic sound. When the sound reflects off of an object, it returns and causes a signal on the digital input (interrupt) pin. EasyC computes the round trip time of the sound and converts that time to inches based on the speed of sound.

Man... EasyC really does take all the fun* out of coding...

Anyways, thanks for your help Brad.

-Dillon

*By fun I mean sleepless nights of checking syntax and stressful days of trying to write an autonomous a day before ship, when you've finally gotten your hands on the robot for more than 5 minutes.
__________________
www.metalmoose.com
  #4   Spotlight this post!  
Unread 24-01-2006, 14:15
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Ultrasonic Sensor output

Fun* is overrated.

Glad you got it working. Make sure when you do your final program the assignments are correct in the "Main" function for the inputs and output. Also don't use ports 1-6 as an output as it will use a valuable interrupt. Ports 10-18 are already assigned outputs FYI.
  #5   Spotlight this post!  
Unread 01-02-2006, 18:14
Erics626's Avatar
Erics626 Erics626 is offline
Cool, Calm, Collected
None #1018 (Robodevils)
Team Role: Electrical
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Pike High School, Indianapolis, Ind
Posts: 69
Erics626 is a jewel in the roughErics626 is a jewel in the roughErics626 is a jewel in the rough
Send a message via AIM to Erics626
Re: Ultrasonic Sensor output

Does anyone know if you can use the Parallax ultrasonics using EasyC. We are having some difficulty getting them to work.
__________________
Championship Finalist - 2006 Buckeye Regional (Thanks 461 and 141!)
Fourth Year FIRST Member
Third Year Electrical Team Leader
First Year BEST and FIRST Robotics Team Co-Leader
Second Place - Robotics Competition, 2005 Bearcat BEST
Second Place - BEST Competition, 2005 Bearcat BEST
Most Photogenic - 2005 Bearcat BEST
Most Robust - 2005 Bearcat BEST
Fourth Place - Robotics Competion, 2005 Nationals(South's BEST)
"Get your philosophy from a bumber sticker."-Billie Joe Armstrong
  #6   Spotlight this post!  
Unread 03-02-2006, 10:20
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Ultrasonic Sensor output

Quote:
Originally Posted by Erics626
Does anyone know if you can use the Parallax ultrasonics using EasyC. We are having some difficulty getting them to work.
Only the VEX/Daventech are currently supported in EasyC.
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 Range Finder polyBot Control System 15 29-01-2006 12:46
Vex navigation with ultrasonic and encoders GlennGraham Electrical 4 13-01-2006 12:58
VEX UltraSonic and Encoder SOLD OUT... Chris_Elston Electrical 5 09-01-2006 13:22
Ultrasonic Sensor winners Programming 3 02-01-2006 20:55
Using and Coding an ultrasonic sensor Jaine Perotti General Forum 14 06-08-2004 14:13


All times are GMT -5. The time now is 14:12.

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