|
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
|