In the Arduino IDE you have two root code segments, setup and loop. Setup can (should?) be interpreted as 'run once' while loop is loop. Think not of setup as just those statements that initialize everything, but more towards code segments and/or function calls that you only want to run once or maybe even more. In fact you can write your entire code to reside in setup without ever dropping through into loop. If you program outside from the IDE, you deal only with a main() function where all of you top-level logic must reside. To fall into a continuous loop in main() you would use while(1) or for(; which is essentially what loop() in the Arduino IDE does. So, move your code segment into setup or stick it in its own function and call it from setup. If you put it in its own function you then have the option of calling it again later. An alternative is to leave it in loop() and use a flag which is clear on startup. When you enter loop(), and just before your segment, test the flag, if it is still clear fall through and immediately set the flag. Next time around the test will fail and your segment gets skipped.