Thread: potentiometer
View Single Post
  #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.