REVLib - C++
rev::CANDigitalInput Class Referenceabstract

#include <CANDigitalInput.h>

Inherited by rev::SparkMaxLimitSwitch.

Public Types

enum class  LimitSwitchPolarity { kNormallyOpen = 0 , kNormallyClosed = 1 }
 

Public Member Functions

virtual ~CANDigitalInput ()
 
virtual bool Get () const =0
 
virtual REVLibError EnableLimitSwitch (bool enable)=0
 
virtual bool IsLimitSwitchEnabled () const =0
 

Friends

class SparkMaxLimitSwitch
 

Detailed Description

Member Enumeration Documentation

◆ LimitSwitchPolarity

Deprecated:
Use SparkMaxLimitSwitch::Type instead
Enumerator
kNormallyOpen 
kNormallyClosed 

Constructor & Destructor Documentation

◆ ~CANDigitalInput()

virtual rev::CANDigitalInput::~CANDigitalInput ( )
inlinevirtual

Member Function Documentation

◆ Get()

virtual bool rev::CANDigitalInput::Get ( ) const
pure virtual

Returns true if the limit switch is pressed, based on the selected switch type.

This method works even if the limit switch is not enabled.

Returns
true if the limit switch is pressed

Implemented in rev::SparkMaxLimitSwitch.

◆ EnableLimitSwitch()

virtual REVLibError rev::CANDigitalInput::EnableLimitSwitch ( bool  enable)
pure virtual

Enables or disables motor shutdown based on limit switch state. This does not affect the result of the Get() function.

Returns
REVLib

Implemented in rev::SparkMaxLimitSwitch.

◆ IsLimitSwitchEnabled()

virtual bool rev::CANDigitalInput::IsLimitSwitchEnabled ( ) const
pure virtual

Returns true if limit switch is enabled.

Implemented in rev::SparkMaxLimitSwitch.

Friends And Related Function Documentation

◆ SparkMaxLimitSwitch

friend class SparkMaxLimitSwitch
friend

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