Sorry vaj4088, I was just thinking of my rc receiver project reading a transmitter switch position... The position ist printed only once!
So I extended my sketch in this way:
int i = 0;
void setup() {
Serial.begin(9600);
Serial.println("Serial Monitor initialized...");
}
void loop() {
Serial.println(i++);
delay(500);
}
The result is:
Serial Monitor initialized...
0
1
Serial Monitor initialized...
0
1
2
3
4
5
6
7
... and so on ...