Changes between Version 5 and Version 6 of ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous/PWM
- Timestamp:
- Nov 12, 2019, 6:33:11 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous/PWM
v5 v6 7 7 }}} 8 8 9 * Declare variables for the Encoders and Motor controllers in the Robot class9 * Declare variables for the [https://first.wpi.edu/FRC/roborio/beta/docs/java/edu/wpi/first/wpilibj/Encoder.html Encoder] and [https://first.wpi.edu/FRC/roborio/beta/docs/java/edu/wpi/first/wpilibj/Talon.html Talon] (motor controller) objects in the Robot class 10 10 {{{ 11 11 private Talon leftMotor, rightMotor; … … 17 17 // Quadrature encoder has A and B channels connected to DIO0,1, DIO2,3 18 18 leftEncoder = new Encoder(0, 1); 19 rightEncoder = new Encoder(2, 3 );19 rightEncoder = new Encoder(2, 3, true); // right side direction is reversed 20 20 // Peanut wheels are 7.5" in diameter 21 21 // Encoders provide 1 count per degree of rotation … … 25 25 leftMotor = new Talon(0); 26 26 rightMotor = new Talon(1); 27 // right side must turn in opposite direction 28 rightMotor.setInverted(true); 27 29 }}} 28 30