Rotary Encoder

Incremental Rotary Encoders supported by this module use two 'switches', which change state in a Gray Code. This allows them to detect either clockwise or anticlockwise movement.

The encoder should have 3 pins (one common, and two switched). The common should be connected to 3.3v, and the two switched pins should be connected to two pins on Espruino, which should be supplied to the module.

Rotary encoders are handled by the Encoder (About Modules) module.

var step = 0;
require("Encoder").connect(A1,A2,function (direction) {
  step += direction;


(No tutorials are available yet)

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.