Go to Post Our job is to play the game that the GDC gave us, not the one we think they should have given us. - Herodotus [more]
Home
Go Back   Chief Delphi > Technical > Programming > WindRiver C++
CD-Events   CD-Media   CD-Spy   FRC-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 02-15-2012, 10:31 PM
agartner01 agartner01 is offline
Captain + Control Sys & Design
FRC #4174
Team Role: Engineer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Hector MN
Posts: 109
agartner01 is an unknown quantity at this point
KOP rangefinder

So I tried hooking up the KOP rangefinder to the analog breakout, but when I run the program, the only output I get is 0. I can hear the rangefinder pinging, and when I hook up a voltmeter, there is a change in voltage when an object is placed at different positions in front of it.

How I hooked it up:

[/quote]

Code I used:

AnalogChannel *rangefinder;
...
rangefinder = new AnalogChannel(1);
...
std::cout<<rangefinder->getVoltage()<<endl;
Reply With Quote
  #2   Spotlight this post!  
Unread 02-16-2012, 10:38 AM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 7,798
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Send a message via AIM to Alan Anderson
Re: KOP rangefinder

You did plug the sensor into Analog Input 1 on the breakout, right? If it's getting power and outputting a voltage, you have the connector in the right orientation, but it might be on the wrong pins. Do you have code sending raw sensor input to the Dashboard?

Nothing else is configured for AnalogChannel(1), right? If you defined e.g. a gyro on that input earlier, trying to define the sonar sensor on the same input will fail. If that's the problem, I'd expect to see a message to that effect on the Driver Station diagnostic log.
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 11:13 PM.

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


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