A trigger module that provides state management of triggers and trigger intervals based on voltage.
Constructor
Parameter | Type | Description |
---|---|---|
threshold | float |
threshold of voltage that a trigger fires at |
Updates the state of the trigger manager, should be called with every step or poll.
Parameter | Type | Description |
---|---|---|
value | float |
current voltage value |
Returns a boolean value as to a new trigger event has occurred with the latest update.
Returns:
bool
- whether a new trigger event has been detected
Resets the engine to initial state.
Returns the current value that the engine has processed.
Returns:
float
- most recent voltage value from update
The number of steps between trigger events. This will only be available after the second trigger has fired. This value is calculated on every trigger, and will adjust to input changes, but will always be one trigger behind in its calculations.
Returns:
uint32_t
- number of steps between the last two triggers
The number of triggers that have been detected since instantiation or last reset.
Returns:
uint32_t
- number of triggers detected
Whether a trigger event is still considered above the threshold.
Returns:
bool
- whether a trigger can still be considered active
Whether a trigger event is no longer considered above the threshold.
Returns:
bool
- whether a trigger can no longer be considered active