using System;
using System.IO;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using Toolbox;
using Toolbox.NETMF;
using Toolbox.NETMF.NET;
using Microsoft.SPOT.IO;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
namespace lavaggio_mani
{
public class Program
{
//declaration
static string terminale = "porttest";
static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
static OutputPort motore = new OutputPort(Pins.GPIO_PIN_A0, false);
static InterruptPort button1 = new InterruptPort(Pins.GPIO_PIN_A3, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLevelLow);
static InterruptPort button2 = new InterruptPort(Pins.GPIO_PIN_A4, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLevelLow);
static InterruptPort button3 = new InterruptPort(Pins.GPIO_PIN_A5, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLevelLow);
static InterruptPort OnBoardButton = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);
public static void Main()
{
button1.OnInterrupt += new NativeEventHandler(button1_OnInterrupt);
button2.OnInterrupt += new NativeEventHandler(button2_OnInterrupt);
button3.OnInterrupt += new NativeEventHandler(button3_OnInterrupt);
OnBoardButton.OnInterrupt += new NativeEventHandler(button_OnInterrupt);
SetTime();
Thread.Sleep(Timeout.Infinite);
}
now generate:
An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll
on button1.OnInterrupt += new NativeEventHandler(button1_OnInterrupt);
please help!
mb