Go to Post I have trouble believing that there's really a regional that isn't fun... - psquared89 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 14-01-2013, 13:39
luanrookie luanrookie is offline
Registered User
FRC #1772
 
Join Date: Jan 2013
Location: brazil
Posts: 4
luanrookie is an unknown quantity at this point
potentiometer

We are programming the arm with a window motor in java. We are using the potentiometer as reference for the joystick. When the degrees of the potentiometer is greater than the degres of the joystick, the motor will spin until both are in the same degree, and When lower, it will spin to the other position. Always watching the same degrees of the joystick.

we are using this code:

Quote:
Joystick joystick = new Joystick(1);
Jaguar Motor = new Jaguar(1);
AnalogChannel potentiometer = new AnalogChannel(1);
PIDController controling = new PIDController(0.1, 0.001,0.0, potentiometer, Motor);
}
controling.enable();
while (isOperatorControl()) {
controling.setSetpoint((joystick.getX() + 1.0) * 2.5);
Timer.delay(0.10);
Is not working, we think that may be the potentiometer or the code, so my question is, is this code right? if we change the potentiometer it will work?

sorry for bad English, and if we don't leave everything clear is because we are not familiar with forum.
 


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 10:11.

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