Class SparkFlex

All Implemented Interfaces:
REVDevice, AutoCloseable, org.wpilib.hardware.motor.MotorController

public class SparkFlex extends SparkBase
  • Field Details

  • Constructor Details

    • SparkFlex

      public SparkFlex(int busId, int deviceId, SparkLowLevel.MotorType type)
      Create a new object to control a SPARK Flex motor Controller
      Parameters:
      busId - The CAN bus ID this device will be on.
      deviceId - The device ID.
      type - The motor type connected to the controller. Brushless motor wires must be connected to their matching colors and the hall sensor must be plugged in. Brushed motors must be connected to the Red and Black terminals only.
  • Method Details

    • getExternalEncoder

      public RelativeEncoder getExternalEncoder()
      Returns an object for interfacing with an external quadrature encoder
      Returns:
      An object for interfacing with an external quadrature encoder