2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
|
A simple hysteresis filter for giving a bool output for a threshold. More...
#include <hysteresis_filter.h>
Public Member Functions | |
HysteresisFilter ()=delete | |
HysteresisFilter (T deactivateThreshold, T activateThreshold) | |
Construct a new Hysteresis Filter object. | |
bool | operator() (T newValue) |
Gets new status after applying hysteresis. | |
Private Attributes | |
const T | m_activateThreshold |
Threshold above which output becomes true. | |
const T | m_deactivateThreshold |
Threshold below which output becomes false. | |
bool | m_currentState |
Latest state after applying hysteresis. | |
A simple hysteresis filter for giving a bool output for a threshold.
T | Type of threshold values |
|
delete |
|
inline |
Construct a new Hysteresis Filter object.
deactivateThreshold | Value below which output becomes false |
activateThreshold | Value above which output becomes true |
|
inline |
Gets new status after applying hysteresis.
newValue | Latest raw value to update the filter |
|
private |
Threshold above which output becomes true.
|
private |
Latest state after applying hysteresis.
|
private |
Threshold below which output becomes false.