SensorUtil

class wpilib.SensorUtil

Bases: pybind11_builtins.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 checkPDPChannel(channel: int) → bool

Verify that the power distribution channel number is within limits.

Returns

PDP channel is valid

static checkPDPModule(module: int) → bool

Verify that the PDP module number is within limits. module numbers are 0-based

Returns

PDP module 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 checkSolenoidChannel(channel: int) → bool

Verify that the solenoid channel number is within limits.

Returns

Solenoid channel is valid

static checkSolenoidModule(moduleNumber: int) → bool

Check that the solenoid module number is valid. module numbers are 0-based

Returns

Solenoid module is valid and present

static getDefaultSolenoidModule() → int

Get the number of the default solenoid module.

Returns

The number of the default solenoid module.

kAnalogInputs = 8
kDigitalChannels = 31
kPDPChannels = 16
kPwmChannels = 20
kRelayChannels = 4
kSolenoidChannels = 8
kSolenoidModules = 63