Can anyone explain me why I get 'System.ArgumentException' in Microsoft.SPOT.Hardware.dll???
I get the exception in:
sel_4.OnInterrupt += new NativeEventHandler(sel_4_OnInterrupt);
I use the 4.3 framework on netduino 2 plus.
If i try to delete the line...I'll get the exception on the next !
How many interupt can manage the netduino??
using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; namespace Saldatrice { public class Program { const int max_frequency = 1000; private static OutputPort Pin_motore = new OutputPort(Pins.GPIO_PIN_D6, false); private static OutputPort Pin_enable = new OutputPort(Pins.GPIO_PIN_D5, false); private static OutputPort Pin_direzione = new OutputPort(Pins.GPIO_PIN_D7, false); private static OutputPort Pin_rele = new OutputPort(Pins.GPIO_PIN_D4, false); private static InputPort Pin_man_dx = new InputPort(Pins.GPIO_PIN_D11, false, Port.ResistorMode.PullDown); private static InputPort Pin_man_sx = new InputPort(Pins.GPIO_PIN_D10, false, Port.ResistorMode.PullDown); private static int selettore = 0; private static int[] Array_velocita = new int[10]; private static AnalogInput Pin_vel = new AnalogInput(Cpu.AnalogChannel.ANALOG_0); public static int total_passi = 0; public static int passi_inizio = 0; public static int passi_fine = 0; //true devo memorizzare inizio //false devo memorizzare fine public static bool mem_inizio = true; public static void Main() { InterruptPort Pin_avvio_prog = new InterruptPort(Pins.GPIO_PIN_D13, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); Pin_avvio_prog.OnInterrupt += new NativeEventHandler(Pin_avvio_prog_OnInterrupt); InterruptPort Pin_mem_pos = new InterruptPort(Pins.GPIO_PIN_D12, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); Pin_mem_pos.OnInterrupt += new NativeEventHandler(Pin_mem_pos_OnInterrupt); InterruptPort Pin_mem_vel = new InterruptPort(Pins.GPIO_PIN_D9, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); Pin_mem_vel.OnInterrupt += new NativeEventHandler(Pin_mem_vel_OnInterrupt); InterruptPort sel_1 = new InterruptPort(Pins.GPIO_PIN_D8, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_1.OnInterrupt += new NativeEventHandler(sel_1_OnInterrupt); InterruptPort sel_2 = new InterruptPort(Pins.GPIO_PIN_D3, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_2.OnInterrupt += new NativeEventHandler(sel_2_OnInterrupt); InterruptPort sel_3 = new InterruptPort(Pins.GPIO_PIN_D2, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_3.OnInterrupt += new NativeEventHandler(sel_3_OnInterrupt); InterruptPort sel_4 = new InterruptPort(Pins.GPIO_PIN_D1, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_4.OnInterrupt += new NativeEventHandler(sel_4_OnInterrupt); InterruptPort sel_5 = new InterruptPort(Pins.GPIO_PIN_D0, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_5.OnInterrupt += new NativeEventHandler(sel_5_OnInterrupt); InterruptPort sel_6 = new InterruptPort(Pins.GPIO_PIN_A1, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_6.OnInterrupt += new NativeEventHandler(sel_6_OnInterrupt); InterruptPort sel_7 = new InterruptPort(Pins.GPIO_PIN_A2, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_7.OnInterrupt += new NativeEventHandler(sel_7_OnInterrupt); InterruptPort sel_8 = new InterruptPort(Pins.GPIO_PIN_A3, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_8.OnInterrupt += new NativeEventHandler(sel_8_OnInterrupt); InterruptPort sel_9 = new InterruptPort(Pins.GPIO_PIN_A4, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_9.OnInterrupt += new NativeEventHandler(sel_9_OnInterrupt); InterruptPort sel_10 = new InterruptPort(Pins.GPIO_PIN_A5, false, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeHigh); sel_10.OnInterrupt += new NativeEventHandler(sel_10_OnInterrupt); int i=0; while (true) { Debug.Print(i.ToString()); i++; if (i > 100) { i = 0; } System.Threading.Thread.Sleep(2000); } }