Class CANcoder

All Implemented Interfaces:
Sendable, AutoCloseable

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

    • CANcoder

      public CANcoder​(int deviceId)
      Constructs a new CANcoder object.

      Constructs the device using the default CAN bus for the system:

      • "rio" on roboRIO
      • "can0" on Linux
      • "*" on Windows
      Parameters:
      deviceId - ID of the device, as configured in Phoenix Tuner.
    • CANcoder

      public CANcoder​(int deviceId, String canbus)
      Constructs a new CANcoder object.
      Parameters:
      deviceId - ID of the device, as configured in Phoenix Tuner.
      canbus - Name of the CAN bus this device is on. Possible CAN bus strings are:
      • "rio" for the native roboRIO CAN bus
      • CANivore name or serial number
      • SocketCAN interface (non-FRC Linux only)
      • "*" for any CANivore seen by the program
      • empty string (default) to select the default for the system:
        • "rio" on roboRIO
        • "can0" on Linux
        • "*" on Windows
  • Method Details