COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Rotary.hh>
Public Types | |
enum | Direction { NONE = 0x00, CW = 0x10, CCW = 0x20 } |
enum | Mode { HALF_CYCLE, FULL_CYCLE } |
Public Member Functions | |
AcceleratedDial (Board::InterruptPin clk, Board::InterruptPin dt, Mode mode, T initial, T min, T max, T step, T steps) | |
T | value () const |
T | step () const |
void | step (T step) |
T | steps () const |
void | steps (T steps) |
virtual void | on_change (T value) |
Mode | mode () const |
void | mode (Mode mode) |
void | enable () |
void | disable () |
Protected Member Functions | |
Direction | detect () |
Protected Attributes | |
SignalPin | m_clk |
SignalPin | m_dt |
uint8_t | m_state |
Mode | m_mode |
Static Protected Attributes | |
static const uint8_t | half_cycle_table [6][4] |
static const uint8_t | full_cycle_table [7][4] |
Use Rotary Encoder as an accelerated dial (integer). Allows a dial within a given number(T) range (min, max) and a given initial value. Two levels of step (increment/decrement) are allowed and selected depending on timing.
|
inherited |
|
inherited |
|
inline |
Construct Rotary Dial connected to given interrupt pins with given mode, min, max, initial, step on slow turn and steps on fast turn. The mode is one of the Rotary Encoder modes; HALF_CYCLE or FULL_CYCLE.
[in] | clk | interrupt pin. |
[in] | dt | interrupt pin. |
[in] | mode | step. |
[in] | initial | value. |
[in] | min | value. |
[in] | max | value. |
[in] | step | value. |
[in] | steps | value. |
|
protectedinherited |
Detect Rotary Encoder state change. Reads current input pin values and performs a possible state change. Return turn direction or none.
Definition at line 222 of file Rotary.cpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
staticprotectedinherited |
Full-cycle state transition tables.
Full-cycle state table (emits a code at 00 only)
|
staticprotectedinherited |
|
protectedinherited |