Arduino 101 not working on external power

I am not able to run my arduino 101 on external power. The code below runs fine when connected to the web editor. However, it does not run when I connect to a USB 120V adapter.

Code ======================

#include <CurieTime.h>
#include<Servo.h>
Servo myservo;

void setup() {
while(!Serial) ; // wait for serial port to connect.
Serial.begin(9600); // initialize Serial communication

myservo.attach(10); // Control pin for servo

setTime(18, 50, 00, 8, 5, 2017); // HH MM SS DD MM YYYY
myservo.attach(10); // Control pin for servo
}

void loop() {

Serial.print("Time = ");
print2digits(hour());
Serial.write(’:’);
print2digits(minute());
Serial.write(’:’);
print2digits(second());
Serial.println();

if ( (hour() == 18) && (minute() == 50) && (second()== 3) ) {
myservo.write(10); // Turn on light
delay(250);
myservo.write(35);
delay(250);
myservo.write(10); // Turn on light
delay(250);
myservo.write(35);
}
delay(1000);
}

void print2digits(int number) {
if (number >= 0 && number < 10) {
Serial.write(‘0’);
}
Serial.print(number);
}

Remove the "while serial" as it is waiting for a connection to the serial port.

External power will not provide the serial signal it is expecting and waiting for.

Thank you Ballscrewbob!! That fixed the issue!!

Hmm thats very cool, I wasn't expecting something like that to have such an effect