Need help to factory reset by hardware

hi all.
i accidentally upload this sketch (bellow) to arduino mega 2560.
it loops every 1 sec and send out a message "hi there" to USB port, prolem is now i can't upload new sketch to the board via USB port because the board it using that port to send out message, i need to factory reset the board or clear sketch in boad by harware way.
any one can help ?.

this is the sketch is uploaded:

#include <SoftwareSerial.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
Serial.print("hi there \r\n");
delay(1000);
}

You don't need to do anything special to overwrite that sketch. Close your serial monitor if you have it open, and upload a new sketch as normal.

In future please post code (and error messages) using code tags as described in https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code-and-common-code-problems.

Hi, @vutan0306

What IDE and OS are you using?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.