RSeries astromech firmware
AnoRotaryEncoder Class Reference

#include <encoder/AnoRotaryEncoder.h>

+ Inheritance diagram for AnoRotaryEncoder:
+ Collaboration diagram for AnoRotaryEncoder:

Public Member Functions

 AnoRotaryEncoder (PinManager &pinManager, byte encoderA, byte encoderB, byte buttonUp, byte buttonLeft, byte buttonDown, byte buttonRight, byte buttonIn, bool useInterrupt=true)
 
void setButtonNotify (byte pin, void(*notify)(bool))
 
bool hasButtonStateChanged () const
 
uint8_t getButtonPressedMask () const
 
bool isButtonPressed (byte pin) const
 
bool isButtonReleased (byte pin) const
 
virtual void animate () override
 Subclasses must implement this function to run through a single frame of animation/activity. More...
 
- Public Member Functions inherited from RotaryEncoder
 RotaryEncoder (byte pin1, byte pin2, LatchMode mode=LatchMode::kFour0, bool useInterrupt=true)
 
virtual void setup () override
 Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor. More...
 
void begin ()
 
void end ()
 
bool hasChanged ()
 Returns true if value has changed since last animated event. More...
 
long getValue ()
 Returns current value. More...
 
bool isActive ()
 Returns true if recently used (<250ms) More...
 
Direction getDirection ()
 Return the direction the knob was rotated last time. More...
 
void setValue (long newValue)
 Sets the current value. More...
 
uint32_t getMillisBetweenRotations () const
 Returns time in milliseconds between the current observed. More...
 
uint32_t getRPM ()
 Returns the RPM. More...
 
- Public Member Functions inherited from SetupEvent
 SetupEvent ()
 Default Constructor. More...
 

Additional Inherited Members

- Public Types inherited from RotaryEncoder
enum  Direction { Direction::kNoRotation = 0, Direction::kClockwise = 1, Direction::kCounterClockwise = -1 }
 
enum  LatchMode { LatchMode::kFour3 = 1, LatchMode::kFour0 = 2, LatchMode::kTwo03 = 3 }
 
- Static Public Member Functions inherited from SetupEvent
static void ready ()
 Calls setup() for each created AnimatedEvent subclass. More...
 
- Protected Member Functions inherited from RotaryEncoder
virtual void interrupt () override
 

Constructor & Destructor Documentation

◆ AnoRotaryEncoder()

AnoRotaryEncoder::AnoRotaryEncoder ( PinManager pinManager,
byte  encoderA,
byte  encoderB,
byte  buttonUp,
byte  buttonLeft,
byte  buttonDown,
byte  buttonRight,
byte  buttonIn,
bool  useInterrupt = true 
)
inline

Member Function Documentation

◆ animate()

virtual void AnoRotaryEncoder::animate ( )
inlineoverridevirtual

Subclasses must implement this function to run through a single frame of animation/activity.

Subclasses should not call delay() or otherwise block.

Reimplemented from RotaryEncoder.

◆ getButtonPressedMask()

uint8_t AnoRotaryEncoder::getButtonPressedMask ( ) const
inline

◆ hasButtonStateChanged()

bool AnoRotaryEncoder::hasButtonStateChanged ( ) const
inline

◆ isButtonPressed()

bool AnoRotaryEncoder::isButtonPressed ( byte  pin) const
inline

◆ isButtonReleased()

bool AnoRotaryEncoder::isButtonReleased ( byte  pin) const
inline

◆ setButtonNotify()

void AnoRotaryEncoder::setButtonNotify ( byte  pin,
void(*)(bool)  notify 
)
inline

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