Go to Post Courtesy is the key. - Tom Schindler [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-01-2012, 13:38
SoyStuff SoyStuff is offline
Registered User
FRC #1257
 
Join Date: Jan 2012
Location: Brooklyn
Posts: 29
SoyStuff is a jewel in the roughSoyStuff is a jewel in the roughSoyStuff is a jewel in the rough
Ultrasonic Sensor

We're writing our robot's code in C++. So far, so good, but we can't seem to figure out how to work with the ultrasonic sensor that came with the kit of parts. We're using the AnalogChannel class, but that isn't working. How should we initialize it. We can't use the Ultrasonic class because that's designed for a different ultrasonic sensor. The one that we're using, which is the one from the kit of parts, can be found at this website: https://www.adafruit.com/products/172. Does anyone have any idea what we should do? What class do we use? Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 28-01-2012, 14:04
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Ultrasonic Sensor

AnalogChannel works as intended - Which probably means you aren't initializing it right or you're hooking it up wrong. If you have it hooked into slot 1 at port X, you should have something along the lines of

AnalogChannel* ultrasonic = new AnalogChannel(1, X);

Then, you just do ultrasonic->GetVoltage(); to return the voltage back from it.

As a reference, http://maxbotix.com/products/LV.htm
I don't recall the exact model, but make sure pin 1 is grounded to the analog input module (0v, or -, depending on the markings on the analog input module), pin 2 is connected to the +5V on the analog input module, and pin 5, the voltage output (not any of the other pins), is connected to the sensor pin on the analog module.
__________________
Attending: MN Duluth Regional
Reply With Quote
Reply


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


All times are GMT -5. The time now is 20:30.

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