Arduino Toolkit - @rotaryEncoder/rotaryEncoder


: obj = rotaryEncoder (ar, chanApin, chanBpin)
: obj = rotaryEncoder (ar, chanApin, chanBpin, ppr)

Create a rotaryEncoder object controlled by the input pins.

Inputs

ar - connected arduino object.

chanApin - pin used for channel A

chanBpin - pin used for channel B

ppr - count of encoder pulsed required for a full revolution of the encoder.

Outputs

obj - created rotary encoder object

Example

 a = arduino ();
 enc = rotaryEncoder(a, "d2", "d3", 180);
 

Properties

The rotaryEncoder object has the following public properties:

parent

The parent (arduino) for this device

pins

pins used by this object

ppr

Number of pulses used per rotation

See also: arduino.