Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Need help programming a potentiometer (http://www.chiefdelphi.com/forums/showthread.php?t=112622)

cammy:) 02-02-2013 16:28

Need help programming a potentiometer
 
Hello--
we have been recently trying to program a potentiometer, using LabView's potentiometer example VI on our robot. However, we are using a VEX potentiometer instead, and when we ran the code on our robot we did not get any voltage readings on the front panel or the FRC Driver Station. The program seems to be working fine, but it isn't reading any voltage from the potentiometer.

The potentiometer is currently wired into the analog breakout port 2. Do we need to wire it differently, or modify any parts of the program?

A little assistance would be much appreciated. Thanks!

Ether 02-02-2013 17:28

Re: Need help programming a potentiometer
 
Quote:

Originally Posted by cammy:) (Post 1226524)
Hello--
we have been recently trying to program a potentiometer, using LabView's potentiometer example VI on our robot. However, we are using a VEX potentiometer instead, and when we ran the code on our robot we did not get any voltage readings on the front panel or the FRC Driver Station. The program seems to be working fine, but it isn't reading any voltage from the potentiometer.

The potentiometer is currently wired into the analog breakout port 2. Do we need to wire it differently, or modify any parts of the program?

A little assistance would be much appreciated. Thanks!

Measure the power, signal, and ground pins at the pot with a handheld multimeter and post your results here.



cammy:) 02-02-2013 18:00

Re: Need help programming a potentiometer
 
Ok, so I measured all three pins and they seem to be working fine....

Skyehawk 04-02-2013 18:35

Re: Need help programming a potentiometer
 
Simply declare a new analog channel (Begin.VI); in periodic tasks, get your refurm name (outside the loops) then put a get voltage on the inside of a loop running at about 100 times a second. You will need to multiply the voltage from the get voltage block (located in analog) in order to get an accurate reading. then use this number however you wish, maybe send it to a global variable. You could also run the refurm name and the get voltage in the teleop (although periodic tasks is much more efficient for this sort of thing).

cammy:) 04-02-2013 20:29

Re: Need help programming a potentiometer
 
Ohh, thanks that's really helpful! Could you maybe show me a picture if possible? But thanks!

DonRotolo 05-02-2013 23:02

Re: Need help programming a potentiometer
 
Make sure the potentiometer is wired correctly. The middle goes to the analog signal, one and goes to +5 V, and the other end goes to ground. I am guessing that a Vex potentiometer is wired the same way.


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

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