001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2008-2017. 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;
012import edu.wpi.first.wpilibj.livewindow.LiveWindow;
013
014/**
015 * Texas Instruments / Vex Robotics Jaguar Speed Controller as a PWM device.
016 */
017public class Jaguar extends PWMSpeedController {
018
019  /**
020   * Constructor.
021   *
022   * @param channel The PWM channel that the Jaguar is attached to. 0-9 are on-board, 10-19 are on
023   *                the MXP port
024   */
025  public Jaguar(final int channel) {
026    super(channel);
027
028    /*
029     * Input profile defined by Luminary Micro.
030     *
031     * Full reverse ranges from 0.671325ms to 0.6972211ms Proportional reverse
032     * ranges from 0.6972211ms to 1.4482078ms Neutral ranges from 1.4482078ms to
033     * 1.5517922ms Proportional forward ranges from 1.5517922ms to 2.3027789ms
034     * Full forward ranges from 2.3027789ms to 2.328675ms
035     */
036    setBounds(2.31, 1.55, 1.507, 1.454, .697);
037    setPeriodMultiplier(PeriodMultiplier.k1X);
038    setSpeed(0.0);
039    setZeroLatch();
040
041    HAL.report(tResourceType.kResourceType_Jaguar, getChannel());
042    LiveWindow.addActuator("Jaguar", getChannel(), this);
043  }
044}