private static InterruptPort button = new InterruptPort(Pins.ONBOARD_SW1, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLevelHigh); private static void Main(){ // Attach button listener button.OnInterrupt +=new NativeEventHandler((uint port,uint state, DateTime time) =>{ Debug.Print("Hola")}); }