YWLAElektraBots

VictorSP.class

Jan 26th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.82 KB | None | 0 0
  1. /*----------------------------------------------------------------------------*/
  2. /* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
  3. /* Open Source Software - may be modified and shared by FRC teams. The code   */
  4. /* must be accompanied by the FIRST BSD license file in the root directory of */
  5. /* the project.                                                               */
  6. /*----------------------------------------------------------------------------*/
  7.  
  8. package edu.wpi.first.wpilibj;
  9.  
  10. import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
  11. import edu.wpi.first.wpilibj.hal.HAL;
  12.  
  13. /**
  14.  * VEX Robotics Victor SP Speed Controller.
  15.  */
  16. public class VictorSP extends PWMSpeedController {
  17.   /**
  18.    * Constructor.
  19.    *
  20.    * <p>Note that the VictorSP uses the following bounds for PWM values. These values should work
  21.    * reasonably well for most controllers, but if users experience issues such as asymmetric
  22.    * behavior around the deadband or inability to saturate the controller in either direction,
  23.    * calibration is recommended. The calibration procedure can be found in the VictorSP User Manual
  24.    * available from CTRE.
  25.    *
  26.    * <p>- 2.004ms = full "forward" - 1.52ms = the "high end" of the deadband range - 1.50ms =
  27.    * center of the deadband range (off) - 1.48ms = the "low end" of the deadband range - .997ms =
  28.    * full "reverse"
  29.    *
  30.    * @param channel The PWM channel that the VictorSP is attached to. 0-9 are
  31.    *        on-board, 10-19 are on the MXP port
  32.    */
  33.   public VictorSP(final int channel) {
  34.     super(channel);
  35.  
  36.     setBounds(2.004, 1.52, 1.50, 1.48, .997);
  37.     setPeriodMultiplier(PeriodMultiplier.k1X);
  38.     setSpeed(0.0);
  39.     setZeroLatch();
  40.  
  41.     HAL.report(tResourceType.kResourceType_VictorSP, getChannel());
  42.     setName("VictorSP", getChannel());
  43.   }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment