Class SensorUtil

java.lang.Object
edu.wpi.first.wpilibj.SensorUtil

public final class SensorUtil extends Object
Stores most recent status information as well as containing utility functions for checking channels and error processing.
  • Field Details

    • kSystemClockTicksPerMicrosecond

      public static final int kSystemClockTicksPerMicrosecond
      Ticks per microsecond.
    • kDigitalChannels

      public static final int kDigitalChannels
      Number of digital channels per roboRIO.
    • kAnalogInputChannels

      public static final int kAnalogInputChannels
      Number of analog input channels per roboRIO.
    • kAnalogOutputChannels

      public static final int kAnalogOutputChannels
      Number of analog output channels per roboRIO.
    • kCTRESolenoidChannels

      public static final int kCTRESolenoidChannels
      Number of solenoid channels per module.
    • kPwmChannels

      public static final int kPwmChannels
      Number of PWM channels per roboRIO.
    • kRelayChannels

      public static final int kRelayChannels
      Number of relay channels per roboRIO.
    • kCTREPDPChannels

      public static final int kCTREPDPChannels
      Number of power distribution channels per PDP.
    • kCTREPDPModules

      public static final int kCTREPDPModules
      Number of power distribution modules per PDP.
    • kCTREPCMModules

      public static final int kCTREPCMModules
      Number of PCM Modules.
    • kREVPHChannels

      public static final int kREVPHChannels
      Number of power distribution channels per PH.
    • kREVPHModules

      public static final int kREVPHModules
      Number of PH modules.
  • Method Details

    • checkDigitalChannel

      public static void checkDigitalChannel(int channel)
      Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 0-based.
      Parameters:
      channel - The channel number to check.
    • checkRelayChannel

      public static void checkRelayChannel(int channel)
      Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 0-based.
      Parameters:
      channel - The channel number to check.
    • checkPWMChannel

      public static void checkPWMChannel(int channel)
      Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 0-based.
      Parameters:
      channel - The channel number to check.
    • checkAnalogInputChannel

      public static void checkAnalogInputChannel(int channel)
      Check that the analog input number is value. Verify that the analog input number is one of the legal channel numbers. Channel numbers are 0-based.
      Parameters:
      channel - The channel number to check.
    • checkAnalogOutputChannel

      public static void checkAnalogOutputChannel(int channel)
      Check that the analog input number is value. Verify that the analog input number is one of the legal channel numbers. Channel numbers are 0-based.
      Parameters:
      channel - The channel number to check.
    • getDefaultCTREPCMModule

      public static int getDefaultCTREPCMModule()
      Get the number of the default solenoid module.
      Returns:
      The number of the default solenoid module.
    • getDefaultREVPHModule

      public static int getDefaultREVPHModule()
      Get the number of the default solenoid module.
      Returns:
      The number of the default solenoid module.