Basic Arduino question
Noob questions most welcome!


The old program is erased, and a new one written.
To pause the program, you could try sending the Arduino to sleep, but then you would need an interrupt to wake it up again and resume processing. You could also put the Arduino into a another loop waiting for an input to continue.


e.g.

while(1) {
    delay(100);
    if (digitalRead(2,LOW)) break;
}


This will keep the program stuck in the while loop until pin 2 is brought low (checking every 100ms). Make sure to set pin 2 to an input pin in setup(), e.g.:

pinMode(2,INPUT);


The difference between putting the Arduino to sleep and putting it in a loop is that sleep mode consumes less power.