static void Main(string[] args) { ArduinoConnection arduinoConnection = new ArduinoConnection("COM4", 115200); if (args.Length > 0) { arduinoConnection.ProgramSecurityRegisterUserFieldData(args[0]); } System.Console.WriteLine(arduinoConnection.ReadSecurityRegister()); }
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); } }