Changes between Version 5 and Version 6 of ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous/PWM


Ignore:
Timestamp:
Nov 12, 2019, 6:33:11 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous/PWM

    v5 v6  
    77}}}
    88
    9 *  Declare variables for the Encoders and Motor controllers in the Robot class
     9*  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
    1010{{{
    1111   private Talon leftMotor, rightMotor;
     
    1717   // Quadrature encoder has A and B channels connected to DIO0,1, DIO2,3
    1818   leftEncoder = new Encoder(0, 1);
    19    rightEncoder = new Encoder(2, 3);
     19   rightEncoder = new Encoder(2, 3, true); // right side direction is reversed
    2020   // Peanut wheels are 7.5" in diameter
    2121   // Encoders provide 1 count per degree of rotation
     
    2525   leftMotor = new Talon(0);
    2626   rightMotor = new Talon(1);
     27   // right side must turn in opposite direction
     28   rightMotor.setInverted(true);
    2729}}}
    2830