001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005// THIS FILE WAS AUTO-GENERATED BY ./wpilibj/generate_pwm_motor_controllers.py. DO NOT MODIFY
006
007package org.wpilib.hardware.motor;
008
009import org.wpilib.hardware.hal.HAL;
010
011/**
012 * REV Robotics SPARKMini Motor Controller.
013 *
014 * <p>Note that the SPARKMini uses the following bounds for PWM values. These values should work
015 * reasonably well for most controllers, but if users experience issues such as asymmetric behavior
016 * around the deadband or inability to saturate the controller in either direction, calibration is
017 * recommended. The calibration procedure can be found in the SPARKMini User Manual available from
018 * REV Robotics.
019 *
020 * <ul>
021 *   <li>2.500ms = full "forward"
022 *   <li>1.510ms = the "high end" of the deadband range
023 *   <li>1.500ms = center of the deadband range (off)
024 *   <li>1.490ms = the "low end" of the deadband range
025 *   <li>0.500ms = full "reverse"
026 * </ul>
027 */
028public class SparkMini extends PWMMotorController {
029  /**
030   * Constructor.
031   *
032   * @param channel The SmartIO channel that the SPARKMini is attached to.
033   */
034  @SuppressWarnings("this-escape")
035  public SparkMini(final int channel) {
036    super("SparkMini", channel);
037
038    setBoundsMicroseconds(2500, 1510, 1500, 1490, 500);
039    m_pwm.setOutputPeriod(5);
040    setThrottle(0.0);
041
042    HAL.reportUsage("IO", getChannel(), "RevSPARK");
043  }
044}