REVLib - C++
rev::SparkMaxLimitSwitch Class Reference

#include <SparkMaxLimitSwitch.h>

Inherits rev::CANDigitalInput.

Inherited by rev::SparkLimitSwitch.

Public Types

enum class  Type { kNormallyOpen = 0 , kNormallyClosed = 1 }
 
- Public Types inherited from rev::CANDigitalInput
enum class  LimitSwitchPolarity { kNormallyOpen = 0 , kNormallyClosed = 1 }
 

Public Member Functions

 SparkMaxLimitSwitch (SparkMaxLimitSwitch &&)=default
 
SparkMaxLimitSwitchoperator= (SparkMaxLimitSwitch &&)=default
 
 SparkMaxLimitSwitch (const SparkMaxLimitSwitch &)=default
 
 ~SparkMaxLimitSwitch () override=default
 
bool Get () const override
 
REVLibError EnableLimitSwitch (bool enable) override
 
bool IsLimitSwitchEnabled () const override
 
- Public Member Functions inherited from rev::CANDigitalInput
virtual ~CANDigitalInput ()
 

Friends

class CANSparkBase
 
class SparkLimitSwitch
 

Detailed Description

Member Enumeration Documentation

◆ Type

enum class rev::SparkMaxLimitSwitch::Type
strong

Represents whether the circuit is open or closed when the switch is not being pressed

Deprecated:
Use SparkLimitSwitch::Type instead
Enumerator
kNormallyOpen 
kNormallyClosed 

Constructor & Destructor Documentation

◆ SparkMaxLimitSwitch() [1/2]

rev::SparkMaxLimitSwitch::SparkMaxLimitSwitch ( SparkMaxLimitSwitch &&  )
default

◆ SparkMaxLimitSwitch() [2/2]

rev::SparkMaxLimitSwitch::SparkMaxLimitSwitch ( const SparkMaxLimitSwitch )
default

◆ ~SparkMaxLimitSwitch()

rev::SparkMaxLimitSwitch::~SparkMaxLimitSwitch ( )
overridedefault

Member Function Documentation

◆ operator=()

SparkMaxLimitSwitch & rev::SparkMaxLimitSwitch::operator= ( SparkMaxLimitSwitch &&  )
default

◆ Get()

bool SparkMaxLimitSwitch::Get ( ) const
overridevirtual

Get the state of the limit switch, whether or not it is enabled (limiting the rotation of the motor).

Implements rev::CANDigitalInput.

◆ EnableLimitSwitch()

REVLibError SparkMaxLimitSwitch::EnableLimitSwitch ( bool  enable)
overridevirtual

Enables or disables controller shutdown based on limit switch.

Implements rev::CANDigitalInput.

◆ IsLimitSwitchEnabled()

bool SparkMaxLimitSwitch::IsLimitSwitchEnabled ( ) const
overridevirtual

Returns true if limit switch is enabled.

Implements rev::CANDigitalInput.

Friends And Related Function Documentation

◆ CANSparkBase

friend class CANSparkBase
friend

◆ SparkLimitSwitch

friend class SparkLimitSwitch
friend

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