SensorUtil

class wpilib.SensorUtil

Bases: pybind11_object

Stores most recent status information as well as containing utility functions for checking channels and error processing.

static checkAnalogInputChannel(channel: int) bool

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.

Returns:

Analog channel is valid

static checkAnalogOutputChannel(channel: int) bool

Check that the analog output number is valid.

Verify that the analog output number is one of the legal channel numbers. Channel numbers are 0-based.

Returns:

Analog channel is valid

static checkDigitalChannel(channel: int) bool

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.

Returns:

Digital channel is valid

static checkPWMChannel(channel: int) bool

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.

Returns:

PWM channel is valid

static checkRelayChannel(channel: int) bool

Check that the relay channel number is valid.

Verify that the channel number is one of the legal channel numbers. Channel numbers are 0-based.

Returns:

Relay channel is valid

static getDefaultCTREPCMModule() int

Get the number of the default solenoid module.

Returns:

The number of the default solenoid module.

static getDefaultREVPHModule() int

Get the number of the default solenoid module.

Returns:

The number of the default solenoid module.

kAnalogInputs = 8
kAnalogOutputs = 2
kDigitalChannels = 31
kPwmChannels = 20
kRelayChannels = 4