Package com.cdarobotics.cdalib.bindings
Class ToggleBinding
java.lang.Object
com.cdarobotics.cdalib.bindings.Binding
com.cdarobotics.cdalib.bindings.ToggleBinding
A
Binding that flips its state on each rising edge of the underlying condition.
The raw condition is treated as a "button": every time it transitions from false to true,
the toggle inverts. getStatus() returns the latched toggle state, not the raw button.
Because edge detection is stateful, getStatus() should be polled exactly once per loop.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.cdarobotics.cdalib.bindings.Binding
getCondition, getId
-
Constructor Details
-
ToggleBinding
- Parameters:
condition- the momentary "button" condition whose rising edges flip the toggleid- the unique name used to register and look up this binding
-
-
Method Details