Table of Contents

Class Debounce

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

Stops a flickering input from acting until it has settled.

public sealed class Debounce : IDisposable
Inheritance
Debounce
Implements
Inherited Members

Remarks

A float switch or a contact bounces as it changes; requiring several agreeing readings keeps one bounce from starting a pump.

Constructors

Debounce(ushort, bool)

Creates a debouncer at the given settling length.

public Debounce(ushort samples, bool initial)

Parameters

samples ushort

How many agreeing readings are needed to change state.

initial bool

The state to start in.

Properties

State

Gets the settled state.

public bool State { get; }

Property Value

bool

Methods

Dispose()

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

public void Dispose()

Update(bool)

Feeds a raw reading in and returns the settled state.

public bool Update(bool raw)

Parameters

raw bool

The latest unfiltered reading.

Returns

bool

The debounced state.