using System; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; namespace NetduinoPlusApplication_MotionDetection { public class Program { static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); static InterruptPort port = new InterruptPort(Pins.GPIO_PIN_D0, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow); public static void Main() { // write your code here Debug.Print("Application Start!"); port.OnInterrupt += new NativeEventHandler(port_OnInterrupt); port.EnableInterrupt(); Thread.Sleep(Timeout.Infinite); } static void port_OnInterrupt(uint portId, uint state, DateTime time) { Debug.Print("Interrupt fired"); led.Write(true); Thread.Sleep(1000); led.Write(false); Thread.Sleep(1000); port.ClearInterrupt(); } } }
Can anyone offer any suggestions for me as im stuck with this one?
Thanks in advance.