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

GetRisingUpdate() public method

Returns true if there is a rising edge and updates the internal state
public GetRisingUpdate ( bool trigger ) : bool
trigger bool Current value of edge triggered state
return bool
        public bool GetRisingUpdate(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));
 }