Dear all,
From yesterday I face one problem and still I am struggling. Seeking anybody help in this regards. I got an error An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll. After some trial and error I found that suppose I change PIN number (i.e, instead of A0 if I use A1 or etc. and instead of D8 etc.) it is working fine. So, why we can not combinate A0 and D8. This is limitation or something wrong.
Kindly Help.
Viren
I am using N+2 and the sample code in as below.
using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino;
static class Module1 {
public static void Main() { // write your code here InterruptPort testport = default(InterruptPort); InterruptPort loop1 = default(InterruptPort); testport = new InterruptPort(Pins.GPIO_PIN_D8, false, ResistorModes.Disabled, InterruptModes.InterruptEdgeHigh); testport.OnInterrupt += new NativeEventHandler(testport_OnInterrupt); loop1 = new InterruptPort(Pins.GPIO_PIN_A0, false, ResistorModes.Disabled, InterruptModes.InterruptEdgeBoth); loop1.OnInterrupt += new NativeEventHandler(Loop1_OnInterrupt); Thread.Sleep(Timeout.Infinite); }
private static void testport_OnInterrupt(uint port, uint state, DateTime time) { Debug.Print("Test Port"); }
private static void Loop1_OnInterrupt(uint port, uint state, DateTime time) { Debug.Print("Loop"); }
}