CSharpRoboticsLib.FlowControl.EdgeTrigger.GetFallingUpdate C# (CSharp) Method

GetFallingUpdate() public method

Returns true if there is a falling edge and updates the internal state
public GetFallingUpdate ( bool trigger ) : bool
trigger bool Current value of edge triggered state
return bool
        public bool GetFallingUpdate(bool trigger)
        {
            bool toReturn = (!trigger && m_feedback);
            m_feedback = trigger;
            return toReturn;
        }

Usage Example

 public void AutoUpdateRisingToFalling()
 {
     EdgeTrigger t = new EdgeTrigger();
     t.Update(false);
     Assert.IsTrue(t.GetRisingUpdate(true));
     Assert.IsTrue(t.GetFallingUpdate(false));
 }