How to run the program only ONCE?

I am a beginner of arduino, and what I use is the arduino uno.

After I upload the program to arduino, it just keeps running. How can I make the program run only once?

I'm no expert, but you should be able to remove the "loop" routine. Don't quote me on that though, I'm new to this stuff as well.

You need the loop() so that it will compile...Just put all of your relevant code in the setup() routine

...or put a "while (1);" after the code you want to run just once.

I'm surprised this didn't show up in a search; it comes up here about once a month.

Maybe the developers can just do a simple function called noLoop(), call it anywhere inside your loop to stop looking, how's that sound? :grin:

#define noLoop() while(1)

BTW, processing has a noLoop() function to call if you don't want to loop in the draw().

My favourite is:

#define EVER (;;)

// then...
for EVER;

AWOL:
My favourite is:

#define EVER (;;)

// then...
for EVER;

Hehe. I like that.

me too.