Hello,
i would like to fire an Event when I press the Ldr0 button, so i have written the following Code:
public static void Main()
{
InterruptPort Ldr0 = new InterruptPort(FEZPandaIII.Gpio.Ldr0, false, Port.ResistorMode.PullUp, rt.InterruptMode.InterruptEdgeLevelLow);
Ldr0.OnInterrupt += new NativeEventHandler(Ldr0_OnInterrupt);
SerialPort UART1 = new SerialPort("COM1", 115200);
MotorController MController = new MotorController(UART1);
}
static void Ldr0_OnInterrupt(uint data1, uint data2, DateTime time)
{
OutputPort LED0 = new OutputPort(FEZPandaIII.Gpio.Led1, true);
LED0.Write(!LED0.Read());
}
So when I press the button the debug Crash with the following message:
The thread ‘’ (0x1) has exited with code 0 (0x0).
Done.
Waiting for debug commands…
The program ‘[6] Micro Framework application: Managed’ has exited with code 0 (0x0).
Does anybody know what’s going wrong ?