View Single Post
  #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