Changes between Version 1 and Version 2 of Position Mode
- Timestamp:
- Feb 13, 2016, 4:21:52 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Position Mode
v1 v2 16 16 In the constructor of your subsystem, you need: 17 17 18 {{{ armMotor.setFeedbackDevice(FeedbackDevice.EncoderType);}}}18 {{{talon.setFeedbackDevice(FeedbackDevice.EncoderType);}}} 19 19 20 {{{ armMotor.configEncoderCodesPerRev(X);}}}20 {{{talon.configEncoderCodesPerRev(X);}}} 21 21 22 22 Note that on QuadEncoders this is the nominal value, not the actual value 23 23 24 {{{ armMotor.setEncPosition(0);}}}24 {{{talon.setEncPosition(0);}}} 25 25 26 26 This will save you a lot of future headache … … 30 30 {{{ 31 31 public void enable() { 32 armMotor.enableControl();32 talon.enableControl(); 33 33 } 34 34 }}} … … 36 36 {{{ 37 37 public void positionMode() { 38 armMotor.changeControlMode(TalonControlMode.Position);39 armMotor.setPID(P, I, D);38 talon.changeControlMode(TalonControlMode.Position); 39 talon.setPID(P, I, D); 40 40 } 41 41 }}} … … 46 46 47 47 {{{ 48 Robot. armSys.positionMode();49 Robot. armSys.enable();48 Robot.SubSystem.positionMode(); 49 Robot.SubSystem.enable(); 50 50 }}} 51 51 … … 53 53 54 54 {{{ 55 Robot. armSys.setArmTalon(1F);55 Robot.SubSystem.<SetCommand>(1F); 56 56 }}} 57 57