Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino
Module Module1
Public led As OutputPort = New OutputPort(Pins.ONBOARD_LED, False)
Sub Main()
Dim button As InterruptPort = New InterruptPort(Pins.ONBOARD_SW1, False, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth)
AddHandler button.OnInterrupt, AddressOf ButtonChange
button.EnableInterrupt()
Thread.Sleep(Timeout.Infinite)
End Sub
Sub ButtonChange(ByVal data1 As UInteger, ByVal data2 As UInteger, ByVal time As Date)
If data2 = 0 Then led.Write(False) Else led.Write(True)
End Sub
End ModuleWhen pushing the onboard button, the onboard led is emitting.












