turn off n turn on device sketch uploaded not working

i uploaded sketch to my arduino yun board successfully.its working fine.when i turn off the device and again turn on , the sketch which i uploaded not working.Is there any solution?? or sholud i upload it again n again

Hi, welcome to the forum. I noticed that no one answered yet, and I have a Yun since a few days :P

Sometimes the Bridge.begin() is slow or doesn't start, or you wait for the Serial monitor or Console to be started. Some solutions are : wait 2.5 seconds before calling Bridge.begin(). The Yun might need 60 seconds to start up, so you have to wait that long.

Can you show your sketch between code tags ?

Peter_n: Can you show your sketch between code tags ?

Yes, please show your code.

Many example sketches start with constructs similar to these:

 // Wait until a Serial Monitor is connected.
  while (!Serial);
 while (!Console) {
    ; // wait for Console port to connect.
  }

If you have anything like that at the beginning of your sketch, nothing will happen until you make a connection to your board. This commonly trips up people who are trying to make a standalone sketch that runs as soon as power is applied.

(These constructs are in the examples because they are trying to show the operation of some process by displaying results on the serial interface or console: showing that output is the whole reason for the sketch, so they wait for a connection so the output isn't missed. However, a standalone sketch usually doesn't need to do this, so there is no need to wait for a connection.)