Arduino uno don't keep the whole program when connecting with alimentation

Hello I have a problem with my sketch of LED. when i connect my arduino with USB the whole sketch is executed, but when i connect the arduino with alimentation only the first fragment of the sketch is executed, and then played again... Please what should to troubleshoot this problem the arduino is connected with 7 leds single colour. Thank you a lot

Please post code and circuit diagram.

A first thought is that the external power supply is not enough to power the whole circuit - what are the specs?

Hello Mr Marco,
Really nice to respond to me,
My power sullpy is 12V 16,5 A
i used 7 outputs for 22 Led in every output
The Leds are 9mm one colour outdoor

Please post code using code tags. See the sticky on how to post.

Circuit? You probably cannot power the LEDs directly from the arduino output.

Long code? Sure is long!

There are much better ways of doing it using functions.

In the meantime, please go and read the instructions, then go back and modify your post (use the "More --> Modify" option to the bottom right of the post) to mark up the code as such so we can review it conveniently and accurately.

Thank you all I found that the problem was due to the power supply so i changed it and worked fine

Code disappeared.

No further learning here then. :roll_eyes:

Paul__B you are a master you don't need to learn from me :)