0

Having this basic example for using the SerialUSB function on the Arduino Due under Windows:

// ARDUINO DUE BLINK LED
void setup(){
  pinMode(13,OUTPUT);
  SerialUSB.begin(2000000);
  while(!SerialUSB){
    digitalWrite(13,HIGH);
    delay(100);
    digitalWrite(13,LOW);
    delay(100);
  }
}

void loop(){
  SerialUSB.println("Hello, World!");
  digitalWrite(13,HIGH);
  delay(100);
  digitalWrite(13,LOW);
  delay(900);
}

I am having trouble understanding which shall be the operating sequence for this use. Normally I follow these steps:

  1. Open Arduino IDE, select Arduino Due (Programming Port) at COM 01, and connect it to PC USB,
  2. Compile and Upload the code,
  3. Open a Serial Monitor App, with COM 02, 2000000 bps or 9600 bps, 8b data, 1b stop, no parity, RTS|CTS flow control.

If I keep the Arduino connected to the Programming Port after trying the Native USB Port, I have to disconnect and connect everything to program it again (??), or disable it through the windows Device Manager.

Which is the proper sequence (and perhaps the code) for doing this the right way?.

3
  • 1
    You have to have flow control set to hardware for the Arduino to know the port has been opened. – Majenko Oct 4 '20 at 22:28
  • 1
    Thanks @Majenko. That solved a big part of the problem. I have updated the question. – Brethlosze Oct 4 '20 at 22:35
  • 1
    @jsotola Can you please repeat, I have updated the question while you answer me. – Brethlosze Oct 4 '20 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.