Toolbox.NETMF.Hardware.IntegratedIRQ

This class inherits all properties of Toolbox.NETMF.Hardware.IIRQPort


Toolbox.NETMF.Hardware.IntegratedIRQ(Pin, GlitchFilter, ResistorMode)
  • Pin The pin number
  • GlitchFilter Turns on or off the glitchfilter (optional)
  • ResistorMode Selects the resistor mode (optional)

Sample code in C#

static IIRQPort Pin = new IntegratedIRQ(Pins.ONBOARD_BTN, false, Port.ResistorMode.Disabled);

public static void Main()
{
    Pin.ID = "Onboard button";
    Pin.OnStateChange += new StateChange(Pin_OnStateChange);

    Thread.Sleep(Timeout.Infinite);
}

static void Pin_OnStateChange(IIRQPort Object, bool State, DateTime Time)
{
    Debug.Print("State of button " + Object.ID + " changed to " + State.ToString());
}

Sample code in VB

Dim WithEvents Pin As IIRQPort = New IntegratedIRQ(Pins.ONBOARD_BTN, False, Port.ResistorMode.Disabled)

Sub Main()
    Pin.ID = "Onboard button"

    Thread.Sleep(Timeout.Infinite)
End Sub

Private Sub Pin_OnStateChange(ByVal PinObject As Toolbox.NETMF.Hardware.IIRQPort, ByVal State As Boolean, ByVal Time As Date) Handles Pin.OnStateChange
    Debug.Print("State of button " + PinObject.ID + " changed to " + State.ToString())
End Sub

Last edited Dec 29, 2012 at 6:44 AM by Garrcomm, version 2