Table of Contents

Class Quadrature

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

Counts a quadrature encoder's steps from its A and B channels.

public sealed class Quadrature : IDisposable
Inheritance
Quadrature
Implements
Inherited Members

Constructors

Quadrature(bool, bool)

Creates a decoder seeded with the channel levels it reads now.

public Quadrature(bool a = false, bool b = false)

Parameters

a bool

The A channel's level now.

b bool

The B channel's level now.

Remarks

Seeding with the real levels keeps the first reading from counting a step that did not happen.

Properties

Count

Gets the signed count of steps so far.

public long Count { get; }

Property Value

long

Methods

Dispose()

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

public void Dispose()

Reset()

Sets the count back to 0, keeping the channel state last read.

public void Reset()

Update(bool, bool)

Feeds the channel levels read now.

public int Update(bool a, bool b)

Parameters

a bool

The A channel's level.

b bool

The B channel's level.

Returns

int

1 or -1 for a step in either direction, or 0 for no change or a jump past a step.