arduino doesn‘t work after changing the power

My microcontroller is mega2560. I tried downloading my sketch by USB connected to the computer to drive the motor and it's successful. after that,I tried to supply the power by dry battery which is 6 volt . it didn't work and the LED in pin13 was always blink . who can help me?

It seems like a power issue. Don't worry, we all had this kind of problem when we started with Arduino.

Do you have a Arduino Mega 2560 board ? And you have a motor connected to it ?

What kind of motor is it ? A servo motor perhaps ?

An Arduino board can not provide the power for a motor. The 5V pin of the Arduino board is for sensors and buttons, but it won't supply enough current for motor.

If you use a 6V battery to the DC power plug, you probably won't have enough voltage and not enough current. Could you try a power supply (wall wart or so) of 7 ... 12V. That should work.