Uploaded sketch not working after power off

Like I said, it's a timing issue. When you upload, or if you press reset, there has been time after power-up. Adding something like:

delay(1000);

... at the start of setup might be all that is required.