Go to Post Theory is when you know everything but nothing works. Practice is when everything works but you don't know why. On our team, theory and practice comes together. Nothing works and nobody knows why. - CalTran [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 04-02-2014, 23:22
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 89
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: Programming a Potentiometer

As Ginto said, you can use an AnalogChannel object to represent your potentiometer but the Java API also has an AnalogPotentiometer class that you can use as well (wpi api link).

When our team uses potentiometers, we tend to correlate the different positions that we are interested in to readings from the potentiometer (e.g. when the arm is in the "up" position, the potentiometer has a reading of x) and then we use a PIDController to get a motor/speed controller to move the mechanism into position. This sounds like what you are talking about but I am not sure.

If you have some more questions, can you give us some specific details on how you are trying to use the potentiometer and what type of potentiometer it is (single-turn-270-degrees or 10-turn or a string potentiometer)? I am assuming that you will be monitoring something other than the output shaft of the mini-cim, like an arm that rotates or an output shaft on a gearbox...but I am sure that more help will come if you can provide a few more details.
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote
 


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 12:44.

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