Generic Class for handling Quadrature Encoders
Inspired/influenced by Mutable Instruments (pichenettes) Encoder classes.
More...
Generic Class for handling Quadrature Encoders
Inspired/influenced by Mutable Instruments (pichenettes) Encoder classes.
- Author
- Stephen Hensley
- Date
- December 2019
#include <encoder.h>
◆ Encoder()
daisy::Encoder::Encoder |
( |
| ) |
|
|
inline |
◆ ~Encoder()
daisy::Encoder::~Encoder |
( |
| ) |
|
|
inline |
◆ Debounce()
void daisy::Encoder::Debounce |
( |
| ) |
|
Called at update_rate to debounce and handle timing for the switch. In order for events not to be missed, its important that the Edge/Pressed checks be made at the same rate as the debounce function is being called.
◆ FallingEdge()
bool daisy::Encoder::FallingEdge |
( |
| ) |
const |
|
inline |
Returns true if the encoder was just released.
◆ Increment()
int32_t daisy::Encoder::Increment |
( |
| ) |
const |
|
inline |
Returns +1 if the encoder was turned clockwise, -1 if it was turned counter-clockwise, or 0 if it was not just turned.
◆ Init()
Initializes the encoder with the specified hardware pins. Update rate is to be deprecated in a future release
◆ Pressed()
bool daisy::Encoder::Pressed |
( |
| ) |
const |
|
inline |
Returns true while the encoder is held down.
◆ RisingEdge()
bool daisy::Encoder::RisingEdge |
( |
| ) |
const |
|
inline |
Returns true if the encoder was just pressed.
◆ SetUpdateRate()
void daisy::Encoder::SetUpdateRate |
( |
float |
update_rate | ) |
|
|
inline |
To be removed in breaking update
- Parameters
-
◆ TimeHeldMs()
float daisy::Encoder::TimeHeldMs |
( |
| ) |
const |
|
inline |
Returns the time in milliseconds that the encoder has been held down.
The documentation for this class was generated from the following file: