You have declared to be local to the loop function so every time you enter loop() the count variable is created anew and initialized to one. You should declare it to be global (outside loop) so that it won't be regenerated all the time.
void setup() {
Serial.begin(9600);
int count=0;
}
int count = 0;
void loop() {
count = count + 1;
Serial.println(count);
delay(1000);
}
Pete
You are declaring an int called count twice. You are declaring it once inside the setup function, it goes away forever as soon as setup exits. Then you declare a new one in loop, it goes away every time loop returns and then a new one is created when loop starts again.
Instead, do the
int count = 0;
part up above the setup function so it will be at global scope. Then just call the variable by it's name and drop the int part ever after that.