[Solved] Stop arduino in setup()

Hello everybody !

I've received my GSM Shield and I'm trying to begin working with it. I'm facing my first issue.

In "setup()", I'm checking for my SIM card PIN code, and I would like my sketch to totally stop until reset if the PIN code is wrong, is there a way (like a builtin function) which stops the arduino or make it wait for something impossible to happen?
I know about infinite loops like "while(1);" or "for(;;);" but I'm looking for something (if it exists) that doesn't waste clock time.

Thanks for your help.

max13:
I know about infinite loops like "while(1);" or "for(;;);" but I'm looking for something (if it exists) that doesn't waste clock time.

Why? If your entering stop condition then the MCU has nothing better to do.
If your trying to save power then look at Nick's excellent guide Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors on power saving and put your MCU to sleep.

Riva:
If your trying to save power then look at Nick's excellent guide Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors on power saving and put your MCU to sleep.

Oh good... It will also be useful for my future projects, I didn't know it's possible to make it sleep. Thank you.

I didn't know it's possible to make it sleep

It is, but there's no reason to do so here unless maybe your widget is battery powered and you need to save that.


Rob