예제 #1
0
 static void Main(string[] args)
 {
     ArduinoConnection arduinoConnection = new ArduinoConnection("COM4", 115200);
     if (args.Length > 0)
     {
         arduinoConnection.ProgramSecurityRegisterUserFieldData(args[0]);
     }
     System.Console.WriteLine(arduinoConnection.ReadSecurityRegister());
 }
예제 #2
0
        static void Main(string[] args)
        {
            var arguments = new ProgramArguments();

            args = Arguments.Parse(args, arguments);

            if (arguments.PrintHelp)
            {
                System.Console.Write(Arguments.GetDescriptionText(arguments));
                Environment.Exit(1);
            }

            ArduinoConnection arduinoConnection = new ArduinoConnection(arguments.Port, arguments.Speed);

            using (var inputStream = GetFileOrUrlStream(args[0]))
            {
                IEnumerable pageEnumerable = IsBitFile(args[0]) ?
                    (IEnumerable) new BitFilePageCollection(inputStream, Constants.UserStartAddress) :
                    (IEnumerable) new BinFilePageCollection(inputStream, Constants.UserStartAddress);
                arduinoConnection.UploadPages(pageEnumerable);
            }
        }