lib Modulove
Library for building custom scripts for Modulove modules.
Public Types | Public Member Functions | List of all members
modulove::Encoder Class Reference

Public Types

enum  Direction { DIRECTION_UNCHANGED , DIRECTION_INCREMENT , DIRECTION_DECREMENT }
 Enum constants for encoder rotation increment/decrement state.
 
enum  PressType { PRESS_NONE , PRESS_SHORT , PRESS_LONG }
 Enum for type of switch press.
 

Public Member Functions

void setDirection (byte direction)
 Set the encoder direction by passing 0 for cw increment or 1 for ccw increment.
 
Direction Rotate ()
 Get the rotary direction if it has turned. More...
 
Direction rotate ()
 
Direction rotate_reversed ()
 
PressType Pressed ()
 
bool ShortPressed ()
 
bool LongPressed ()
 

Member Function Documentation

◆ LongPressed()

bool modulove::Encoder::LongPressed ( )
inline
Returns
Return true if the button has been held down for (n) milliseconds.

◆ Pressed()

PressType modulove::Encoder::Pressed ( )
inline
Returns
Return the press type if the switch was released this loop.

◆ Rotate()

Direction modulove::Encoder::Rotate ( )
inline

Get the rotary direction if it has turned.

Returns
Direction of turn or unchanged.

◆ ShortPressed()

bool modulove::Encoder::ShortPressed ( )
inline
Returns
Return true if the button has been held down for less than (n) milliseconds.

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