Home:ALL Converter>Upload to arduino C#

Upload to arduino C#

Ask Time:2019-03-05T00:32:37         Author:user4929740

Json Formatter

I am trying to upload a blink.hex file to an Arduino through C# using this code:

                string Folder1 = @"C:\Program Files(x86)\Arduino\hardware\tools\avr/bin/avrdude";
            string Folder2 = @"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf";
            string Hexpath = @"C:\VG-Break In\HEX\VBISU.ino.hex";
            string arg =
                "-C" + Folder2
                + "-v -patmega328p -carduino  -P" +
                 cmbports.SelectedText.ToString() +
                "-b115200 -D -Uflash:w:" + Hexpath + "i";

            Process.Start(@"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" ,arg);

But it doesn't upload. I just see that cmd blinks for a fraction of a second...

The line I see in my Arduino IDE when uploading is:

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM5 -b115200 -D -Uflash:w:C:\Users\VICTOR~1\AppData\Local\Temp\arduino_build_426502/VBISU.ino.hex:i 

Author:user4929740,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54987576/upload-to-arduino-c-sharp
yy