Class CANcoder

All Implemented Interfaces:
PhoenixAlertable, CommonDevice, AutoCloseable, org.wpilib.telemetry.TelemetryLoggable

public class CANcoder extends CoreCANcoder implements AutoCloseable, org.wpilib.telemetry.TelemetryLoggable
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
    • logTo

      public void logTo(org.wpilib.telemetry.TelemetryTable table)
      Logs the object to a TelemetryTable.
      Specified by:
      logTo in interface org.wpilib.telemetry.TelemetryLoggable
      Parameters:
      table - telemetry table
    • getTelemetryType

      Gets the telemetry table type.
      Specified by:
      getTelemetryType in interface org.wpilib.telemetry.TelemetryLoggable
      Returns:
      Table type