001/*----------------------------------------------------------------------------*/
002/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj;
009
010import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
011import edu.wpi.first.wpilibj.hal.HAL;
012
013/**
014 * VEX Robotics Victor SP Speed Controller.
015 */
016public class VictorSP extends PWMSpeedController {
017  /**
018   * Constructor.
019   *
020   * <p>Note that the VictorSP uses the following bounds for PWM values. These values should work
021   * reasonably well for most controllers, but if users experience issues such as asymmetric
022   * behavior around the deadband or inability to saturate the controller in either direction,
023   * calibration is recommended. The calibration procedure can be found in the VictorSP User Manual
024   * available from CTRE.
025   *
026   * <p>- 2.004ms = full "forward" - 1.52ms = the "high end" of the deadband range - 1.50ms =
027   * center of the deadband range (off) - 1.48ms = the "low end" of the deadband range - .997ms =
028   * full "reverse"
029   *
030   * @param channel The PWM channel that the VictorSP is attached to. 0-9 are
031   *        on-board, 10-19 are on the MXP port
032   */
033  public VictorSP(final int channel) {
034    super(channel);
035
036    setBounds(2.004, 1.52, 1.50, 1.48, .997);
037    setPeriodMultiplier(PeriodMultiplier.k1X);
038    setSpeed(0.0);
039    setZeroLatch();
040
041    HAL.report(tResourceType.kResourceType_VictorSP, getChannel());
042    setName("VictorSP", getChannel());
043  }
044}