So my team needs a PID Controller code for our shooter. All the example code shows this:
Code:
Joystick turretStick(1);
Jaguar turretMotor(1);
AnalogChannel turretPot(1);
PIDController turretControl(0.1, 0.001, 0.0, &turretPot, &turretMotor);
turretControl.Enable(); // start calculating PIDOutput values
while(IsOperator())
{
turretControl.SetSetpoint((turretStick.GetX() + 1.0) * 2.5);
Wait(.02); // wait for new joystick values
}
I cant find anything on using the battery voltage in that code or a talon. Also I read that the speed controllers have a trype of built in PID Loop. One more thing to the the battery volts we are using:
Code:
float volt
.
.
.
volt = DriverStation::GetInstance()->GetBatteryVoltage();