Beispiel #1
0
        static void Main(string[] args)
        {


            // create the arduino connection
            a = new ArduinoConnection();
            // just use the last com port for this.. that one's usually the one
            a.PortName = ArduinoConnection.GetAvailablePorts().Last();

            // create the uploader
            // this is where the root of the ardiono ide installation lives
            var root = @"C:\arduino-1.0.1";
            var tempDir = Environment.CurrentDirectory + "/Temp";

            var info = Uploader.GetUploadConfig(root, tempDir,
                "Arduino Mega 2560 or Mega ADK",
                CommunicationTypeEnum.USB);

            u = new Uploader(info);
            u.OnError += u_OnError;
            u.OnMessage += u_OnMessage;
            u.OnSuccess += u_OnSuccess;

            // do some tests
            runTest(new TestBlink(a, u));
            Thread.Sleep(4000);
            runTest(new TestSendOnOffMessage(a, u));
        }
Beispiel #2
0
 public TestBlink(ArduinoConnection a, Uploader u)
 {
     this.a = a;
     this.u = u;
 }   
 public TestSendOnOffMessage(ArduinoConnection a, Uploader u)
 {
     this.a = a;
     this.u = u;
 }