I set up my software debounce like this:
static long lastDebounceTime = DateTime.Now.Ticks; static long debounceDelay = 100000; //adjust as necessary public static void Main() { InterruptPort input = new InterruptPort(Pins.GPIO_PIN_D4, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth); input.OnInterrupt += new NativeEventHandler(input_OnInterrupt); } static void input_OnInterrupt(uint data1, uint data2, DateTime time) { if ((time.Ticks - lastDebounceTime) > debounceDelay) { lastDebounceTime = time.Ticks; // do stuff } }Thanks everyone for the help.
Some micro optimisation The exact time the interrupt occured is already given, no need to call DateTime.Now.