0

My MKR GSM 1400 works fine when connected to a computer (powered USB) and after opening a serial connection to it. It does not when I plug it into a power supply. My power supply is a 5V 3A with a USB adapter.

void setup() {
  // put your setup code here, to run once:
  //...
  while (!Serial);
  //...
}

void loop() { // put your main code here, to run repeatedly: //... }

Dave X
  • 2,350
  • 15
  • 29
Mike C.
  • 103
  • 3

1 Answers1

5

If your sketch on an Arduino with native USB doesn't run if not connected to USB, always first check if you didn't forget to disable a dependence on Serial. A common error is a while (!Serial) {} endless loop in setup().

Dave X
  • 2,350
  • 15
  • 29
Juraj
  • 18,264
  • 4
  • 31
  • 49