the arduino would be disconnected

hi
by adding the servo motor and testing the swept code after one loop the Arduino L led would be turned off and after a while, the Arduino would be disconnected
why?

Because you tried to power a servo from USB. Don't do that, use a separate supply with at least 1A of
current rating per servo.

MarkT:
Because you tried to power a servo from USB. Don't do that, use a separate supply with at least 1A of
current rating per servo.

thank you so much