Hello,
I am new to .NETMF , i have try to react to an input button with the simple code
void ProgramStarted()
{
// Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
Debug.Print("Program Started");
try
{
Debug.Print("Create Input BT Port");
bt = new InputPort(GHI.Hardware.FEZCerb.Pin.PC0, false, Port.ResistorMode.PullUp);
Debug.Print("Register BT Interrupt");
bt.OnInterrupt += bt_OnInterrupt;
Debug.Print("Enable BT Interrupt");
bt.EnableInterrupt();
}
catch (Exception ex)
{
Debug.Print("Cant setup BT " + ex.Message);
}
}
void bt_OnInterrupt(uint data1, uint data2, DateTime time)
{
Debug.Print("Button press");
}
I have try both Console Project or Gadgeteer but it fails with the follwing exception when adding the interrupt Handler:
Using mainboard GHI Electronics FEZCerbuinoBee version 1.2
Program Started
Create Input BT Port
Register BT Interrupt
Une exception de première chance de type ‘System.InvalidOperationException’ s’est produite dans Microsoft.SPOT.Hardware.dll
Une exception de première chance de type ‘System.InvalidOperationException’ s’est produite dans Microsoft.SPOT.Hardware.dll
Cant setup BT Exception was thrown: System.InvalidOperationException
the board is loaded with the last firmware 4.2.5 ethernet and have and ENC28 1.1
connected and pingable.
I also try other pin (PC1 PA4 ) without success