Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

encoder.h

Joseph Ryan edited this page Aug 19, 2017 · 5 revisions

Go to the source code for encoder.h

Includes

  • #include "gpio.h"

Functions

Function Documention


InitializeEncoder

Initializes an encoder on a pair of pins

tEncoder *InitializeEncoder(tPin a, tPin b, tBoolean invert);

Parameters:

  • a Pin that the encoder A line should be plugged into
  • b Pin that the encoder B line should be plugged into
  • invert Flag to switch the direction that the encoder value is incremented

Returns:

  • Pointer to a tEncoder used by the GetEncoder and ResetEncoder functions

GetEncoder

Gets the accumulated value for an encoder

signed long GetEncoder(tEncoder *enc);

Parameters:

  • enc Pointer to a tEncoder that was returned by the InitializeEncoder function

Returns:

  • Accumulated encoder value

ResetEncoder

Clears any ticks that have been accumulated for an encoder

void ResetEncoder(tEncoder *enc);

Parameters:

  • enc Pointer to a tEncoder that was returned by the InitializeEncoder function

Clone this wiki locally