Skip to main content

Class RotaryEncoder

Digital rotary encoder that uses two-bit Gray Code to encode rotation.

Assembly: Meadow.Foundation.dll
View Source
public class RotaryEncoder : IRotaryEncoder, IDisposable

Derived:
Meadow.Foundation.Sensors.Rotary.RotaryEncoderWithButton

Implements:
Meadow.Peripherals.Sensors.Rotary.IRotaryEncoder, System.IDisposable

Properties

APhasePort

Returns the pin connected to the A-phase output on the rotary encoder.

View Source
protected IDigitalInterruptPort APhasePort { get; }

BPhasePort

Returns the pin connected to the B-phase output on the rotary encoder.

View Source
protected IDigitalInterruptPort BPhasePort { get; }

LastDirectionOfRotation

Gets the last direction of rotation

View Source
public RotationDirection? LastDirectionOfRotation { get; protected set; }

IsDisposed

Is the object disposed

View Source
public bool IsDisposed { get; }

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Events

Rotated

Raised when the rotary encoder is rotated and returns a RotaryTurnedEventArgs object which describes the direction of rotation.

View Source
public event EventHandler<RotaryChangeResult> Rotated
Event Type

System.EventHandler<Meadow.Peripherals.Sensors.Rotary.RotaryChangeResult>

Implements

  • Meadow.Peripherals.Sensors.Rotary.IRotaryEncoder
  • System.IDisposable