Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 327 Bytes

File metadata and controls

9 lines (7 loc) · 327 Bytes

InputStabilizer

Originally developed for stabilizing sensor data, InputStabilizer<T> filters out noise by only returning a value after it appears N times in a row.

var s = new InputStabilizer<string>(3);
s.GetStableInput("open"); // null
s.GetStableInput("open"); // null
s.GetStableInput("open"); // "open"