Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leonardo support #3

Open
cb88 opened this issue Dec 7, 2015 · 0 comments
Open

Leonardo support #3

cb88 opened this issue Dec 7, 2015 · 0 comments

Comments

@cb88
Copy link

@cb88 cb88 commented Dec 7, 2015

I have my own frontend just for Arduino Leonardo's and similar boards that use the Catarina bootloader that I currently use and this is the code I use to program them. I hope it is of use to you.

                mySerial.Close();
                Thread.Sleep(500);

                int OldBaud = mySerial.BaudRate;
                mySerial.BaudRate = 1200; // toggles the Leonardo into programming mode
                mySerial.Open();     
                Thread.Sleep(1000);
                mySerial.Close();
                Thread.Sleep(4000);
                int progPortNum;
                //Note that the port is whatever com port it was before + 1
                //So I grab the port number and add one to it here.
                int.TryParse(mySerial.PortName.Replace("COM", ""), out progPortNum);

                var app = new ConsoleAppLauncher.ConsoleApp(avrDudePath, String.Format(@"""-C{0}"" -v -patmega32u4 -cavr109 -P{1} -b57600 -D -Uflash:w:{2}:i", confPath, String.Format("COM{0}", progPortNum + 1), HexPath));
                app.ConsoleOutput += updateListBox;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.