Class CANcoder

All Implemented Interfaces:
CommonDevice, AutoCloseable

public class CANcoder extends CoreCANcoder implements AutoCloseable
WPILib-integrated version of CoreCANcoder.
  • Constructor Details

    • CANcoder

      public CANcoder(int deviceId, CANBus canbus)
      Constructs a new CANcoder object.
      Parameters:
      deviceId - ID of the device, as configured in Phoenix Tuner
      canbus - The CAN bus this device is on
  • Method Details

    • none

      public static CANcoder none()
      Constructs a stubbed-out CANcoder, where all status signals, controls, configs, etc. perform no action and immediately return OK. This can be used to silence error messages for devices that have been completely removed from the robot.
      Returns:
      Stubbed-out CANcoder
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable