Arduino program does not start when plugged in I am having trouble with my Arduino Mega with getting the program to start when the Arduino is plugged into a computer via USB.  All that happens is the LED turns on and stays on.  The device does not initialize, and only when I press the reset button does it begin the setup.  How can I make the Arduino start the program when it is first plugged into the computer?

EDIT: my code

void setup() {
  Serial.begin(115200);
}

void loop() {
  Serial.println("test");
}


very simple, which is why i don't understand why this is happening
I would recommend you to follow the following instructions step by step to verify your Arduino Mega.


Reboot your computer
Connect the Arduino using the USB cable to PC and check the Arduino itself if there is any jumper wires connected/grounded. If there are then remove them all.
Upload a blank sketch first. Go to File -> New
Verify the Arduino has accepted the blank sketch and resetted.
Upload the Blink sketch from the File -> Examples -> 0.1Basics -> Blink
Verify if the Pin 13/onboard LED is blinking. If yes then go to uploading your sketch, if no then there is a hardware/bootloader problem with your Arduino. Watch this video on how to burn bootloader here. https://www.youtube.com/watch?v=X5achE10rCI