View Single Post
  #2   Spotlight this post!  
Unread 18-03-2011, 18:56
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: PID ... Iterative Robot Question (C++)

You really should use the PIDController, it makes it's own task and everything.
All you need is...

AnalogChannel armtiltpot = new AnalogChannel(4);
Jaguar armtilt = new Jaguar(4);

//P I D input output update_rate
PIDController armtiltcontroller = new PIDController(5, 0, 0, armtiltpot, armtilt, .005);

armtiltcontroller.setEnabled();

Then call: armtiltcontroller.setSetpoint(2.5); to change the setpoint.


Based on what I'm seeing it looks like you code should work.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni