Skip to main content

If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.

A bare minimum sketch that shows this behaviour:

void setup()
{
    Serial.begin(9600);
    Serial.println("Setup");
}

void loop()
{
  Serial.println("Loop");
  delay(1000);
}
    void setup()
    {
        Serial.begin(9600);
        Serial.println("Setup");
    }
    
    void loop()
    {
      Serial.println("Loop");
      delay(1000);
    }

Tested with several boards and Mac and Windows versions of the IDE.

Example output - it goes back to "Setup" when I open the serial monitor:

Restart

Why is this?

If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.

A bare minimum sketch that shows this behaviour:

void setup()
{
    Serial.begin(9600);
    Serial.println("Setup");
}

void loop()
{
  Serial.println("Loop");
  delay(1000);
}

Tested with several boards and Mac and Windows versions of the IDE.

Example output - it goes back to "Setup" when I open the serial monitor:

Restart

Why is this?

If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.

A bare minimum sketch that shows this behaviour:

    void setup()
    {
        Serial.begin(9600);
        Serial.println("Setup");
    }
    
    void loop()
    {
      Serial.println("Loop");
      delay(1000);
    }

Tested with several boards and Mac and Windows versions of the IDE.

Example output - it goes back to "Setup" when I open the serial monitor:

Restart

Why is this?

Tweeted twitter.com/StackArduino/status/731271496841170944
edited tags
Link
sachleen
  • 7.6k
  • 5
  • 39
  • 57
Add example sketch
Source Link
Cybergibbons
  • 5.4k
  • 7
  • 33
  • 51

If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.

A bare minimum sketch that shows this behaviour:

void setup()
{
    Serial.begin(9600);
    Serial.println("Setup");
}

void loop()
{
  Serial.println("Loop");
  delay(1000);
}

Tested with several boards and Mac and Windows versions of the IDE.

Example output - it goes back to "Setup" when I open the serial monitor:

Restart

Why is this?

If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.

Why is this?

If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.

A bare minimum sketch that shows this behaviour:

void setup()
{
    Serial.begin(9600);
    Serial.println("Setup");
}

void loop()
{
  Serial.println("Loop");
  delay(1000);
}

Tested with several boards and Mac and Windows versions of the IDE.

Example output - it goes back to "Setup" when I open the serial monitor:

Restart

Why is this?

added 2 characters in body
Source Link
Cybergibbons
  • 5.4k
  • 7
  • 33
  • 51
Loading
Source Link
Cybergibbons
  • 5.4k
  • 7
  • 33
  • 51
Loading