SPARK MAX - C++ Documentation
rev::CANDigitalInput Class Reference

Public Types

enum  LimitSwitch { kForward, kReverse }
enum  LimitSwitchPolarity { kNormallyOpen = 0, kNormallyClosed = 1 }

Public Member Functions

 CANDigitalInput (CANSparkMax &device, LimitSwitch limitSwitch, LimitSwitchPolarity polarity)
 CANDigitalInput (CANDigitalInput &&)=default
CANDigitalInputoperator= (CANDigitalInput &&)=default
bool Get () const
CANError EnableLimitSwitch (bool enable)
bool IsLimitSwitchEnabled ()

Constructor & Destructor Documentation

◆ CANDigitalInput()

CANDigitalInput::CANDigitalInput ( CANSparkMax device,
LimitSwitch  limitSwitch,
LimitSwitchPolarity  polarity 

Constructs a CANDigitalInput.

deviceThe Spark Max to which the limit switch is attached.
limitSwitchWhether this is forward or reverse limit switch.
polarityWhether the limit switch is normally open or normally closed.

Member Function Documentation

◆ EnableLimitSwitch()

CANError CANDigitalInput::EnableLimitSwitch ( bool  enable)

Enables or disables controller shutdown based on limit switch.

◆ Get()

bool CANDigitalInput::Get ( ) const

Get the value from a digital input channel.

Retrieve the value of a single digital input channel from a motor controller. This method will return the state of the limit input based on the selected polarity, whether or not it is enabled.

◆ IsLimitSwitchEnabled()

bool CANDigitalInput::IsLimitSwitchEnabled ( )

Returns true if limit switch is enabled.

The documentation for this class was generated from the following files: