Rotary encoder library. Uses interrupts for reading rotation,

Fork of RPG by Christopher Anderson

Embed: (wiki syntax)

« Back to documentation index

RPG Class Reference

RPG Class Reference

Rotary Pulse Generator class. More...

#include <RPG.h>

Public Member Functions

 RPG (PinName pA, PinName pB, PinName pPB)
 Constructor(Channel A input pin, Channel B input pin, Pushbutton input pin)
int dir ()
 Direction and amount of rotation since last read: +1 for clockwise -1 for counter-clockwise 0 for no rotation.
bool pb ()
 Reads and debounces push button returns bool result.

Detailed Description

Rotary Pulse Generator class.

Constructor(Channel A input pin, Channel B input pin, Pushbutton input pin)

Definition at line 41 of file RPG.h.


Constructor & Destructor Documentation

RPG ( PinName  pA,
PinName  pB,
PinName  pPB 
)

Constructor(Channel A input pin, Channel B input pin, Pushbutton input pin)

Definition at line 34 of file RPG.cpp.


Member Function Documentation

int dir (  )

Direction and amount of rotation since last read: +1 for clockwise -1 for counter-clockwise 0 for no rotation.

Definition at line 77 of file RPG.cpp.

bool pb (  )

Reads and debounces push button returns bool result.

Definition at line 60 of file RPG.cpp.