DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
RotaryEncoder Class Reference

Class to implement a physical rotary encoder for user selection activities Clockwise moves down/increases speed, counter clockwise moves up/decreases speed. More...

#include <RotaryEncoder.h>

Inheritance diagram for RotaryEncoder:
Inheritance graph
[legend]
Collaboration diagram for RotaryEncoder:
Collaboration graph
[legend]

Public Member Functions

 RotaryEncoder ()
 Constructor for the rotary encoder object.
 
void begin () override
 Not implemented for this device type.
 
UserSelectionAction getUserSelectionAction () override
 Check for any user selection actions This should be called at least once per main loop iteration Note that with a rotary encoder, clockwise is down but also increases speed, and counter clockwise is up but also decreases speed.
 
- Public Member Functions inherited from UserSelectionInterface
virtual ~UserSelectionInterface ()=default
 Destructor for the object.
 
bool throttleInverted ()
 Check if throttle is inverted compared to up/down.
 
void setThrottleInverted ()
 Call this method to ensure throttle is inverted compared to selection options.
 

Private Attributes

Rotary_rotary
 
unsigned long _throttleStepFasterThreshold
 
unsigned long _throttleStepFastestThreshold
 
unsigned long _lastUpThrottleStep
 
unsigned long _lastDownThrottleStep
 

Detailed Description

Class to implement a physical rotary encoder for user selection activities Clockwise moves down/increases speed, counter clockwise moves up/decreases speed.

Constructor & Destructor Documentation

◆ RotaryEncoder()

RotaryEncoder::RotaryEncoder ( )

Constructor for the rotary encoder object.

Here is the call graph for this function:

Member Function Documentation

◆ begin()

void RotaryEncoder::begin ( )
overridevirtual

Not implemented for this device type.

Implements UserSelectionInterface.

◆ getUserSelectionAction()

UserSelectionAction RotaryEncoder::getUserSelectionAction ( )
overridevirtual

Check for any user selection actions This should be called at least once per main loop iteration Note that with a rotary encoder, clockwise is down but also increases speed, and counter clockwise is up but also decreases speed.

Returns
UserSelectionAction::[None|Up|UpFaster|UpFastest|Down|DownFaster|DownFastest]

Implements UserSelectionInterface.

Here is the call graph for this function:

Member Data Documentation

◆ _lastDownThrottleStep

unsigned long RotaryEncoder::_lastDownThrottleStep
private

◆ _lastUpThrottleStep

unsigned long RotaryEncoder::_lastUpThrottleStep
private

◆ _rotary

Rotary* RotaryEncoder::_rotary
private

◆ _throttleStepFasterThreshold

unsigned long RotaryEncoder::_throttleStepFasterThreshold
private

◆ _throttleStepFastestThreshold

unsigned long RotaryEncoder::_throttleStepFastestThreshold
private

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