You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I'm using the Arduino Sketch Uploader to upload some code to my arduino. I have set everything like the com port and fiile, and it gets through that part without any exception. Only, when I connect my arduino through usb and click my upload button, the entire form freezes until I disconnect my arduino. Afterwards it gives me the error "unable to set the serial port state" below you will find my code -
private void button2_Click(object sender, EventArgs e) { button2.Text = "Uploading..."; foreach (string s in checkedListBox1.CheckedItems) { if (s == "Arduino Nano R3 (Recommended )") { model = ArduinoModel.NanoR3; }
`else if (s == "Arduino Nano R2")
{
model = ArduinoModel.NanoR2;
}
else if (s == "Arduino Mega")
{
model = ArduinoModel.Mega2560;
}
else if (s == "Arduino Micro")
{
model = ArduinoModel.Micro;
}
else if (s == "Arduino Uno")
{
model = ArduinoModel.UnoR3;
}
else
{
model = ArduinoModel.NanoR3;
}
}
foreach (string s in checkedListBox2.CheckedItems)
{
port = s;
}
var uploader = new ArduinoSketchUploader(
new ArduinoSketchUploaderOptions()
{
FileName = @file,
PortName = port,
ArduinoModel = model
});
try
{
uploader.UploadSketch();
}
catch (Exception ex)
{
errs = ex.Message;
}
msg = (string)( "Uploading: " + file + ";" + model + ";" + port);
if (errs.Length > 0)
{
label12.Text = errs;
label12.BackColor = Color.Red;
button2.Text = "Failed";
}
else
{
label12.Text = msg;
label12.BackColor = Color.YellowGreen;
button2.Text = "Uploaded";
}
}`
The text was updated successfully, but these errors were encountered:
Hi I'm using the Arduino Sketch Uploader to upload some code to my arduino. I have set everything like the com port and fiile, and it gets through that part without any exception. Only, when I connect my arduino through usb and click my upload button, the entire form freezes until I disconnect my arduino. Afterwards it gives me the error "unable to set the serial port state" below you will find my code -
private void button2_Click(object sender, EventArgs e) { button2.Text = "Uploading..."; foreach (string s in checkedListBox1.CheckedItems) { if (s == "Arduino Nano R3 (Recommended )") { model = ArduinoModel.NanoR3; }
The text was updated successfully, but these errors were encountered: