Using Talon SRX, we updated Eclipse with latest plugins… changed the CANTalon to TalonSRX, now i am stuck on resolving the TalonControlMode.follower
TalonSRX _leftSlave = new TalonSRX(6);
TalonSRX _rightSlave = new TalonSRX(3);
/* take our extra talons and just have them follow the Talons updated in arcadeDrive */
_leftSlave.changeControlMode(TalonControlMode.Follower);
_rightSlave.changeControlMode(TalonControlMode.Follower);
_leftSlave.set(null, 4); /* device IDs here (2 of 2) */
_rightSlave.set(null, 1);
When you instantiate your follower objects, you can immediately set them to follower mode using (obj).set(ControlMode.Follower, <int of master>)
Then when you want to drive the motors, on the “master” Talon that is driving the chassis (say with an axis value from a joystick, or if you’re using a pid style control any other method) use (obj).set(ControlMode.PercentOutput, 1.0)
Can also set follow mode with follow() method (p. 58 of 1/13/2018 version of
TALON SRX / Victor SPX Software Reference Manual)
/* recommended method: use follow routine */
victor.follow(talon);