View Full Version : How to hook up KOP rangefinder
agartner01
08-02-2012, 20:34
Do I just hook it to the analog breakout like in this picture?
http://i41.tinypic.com/28wifm.jpg
kinganu123
08-02-2012, 21:20
Yes
But let your programmers know that they'll have to write their own class that uses the analogchannel. This mainly pertains to java, not sure about other languages.
theprgramerdude
08-02-2012, 21:28
Yes, that will do it. You also don't have to write your own class, per se, as everything in java can be coded almost like in C, although it would be beneficial.
agartner01
08-02-2012, 21:37
Yes
But let your programmers know that they'll have to write their own class that uses the analogchannel. This mainly pertains to java, not sure about other languages.
Yeah, I do both electrical and programming in our 4 person team. So something like this:
float distanceToTarget = 0.0;
...
AnalogChannel *rangefinder;
...
rangefinder = new AnalogChannel(1);
...
rangefinder->getVoltage() * multiplier = distanceToTarget;
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.