[SORTED] - Novice question - Changing pin number in sketch

The code looks like this:

 unsigned long currentMillis = millis();
 
  if(currentMillis - previousMillis > interval)
  {
    // save the last time you blinked the LED 
    previousMillis = currentMillis;   

    // Do something
  }

The first time through the loop function, currentMillis will be a very small value. currentMillis - 0 will still be a small value, so nothing happens. After 999 milliseconds, previosMillis is still 0, and nothing has happened. Finally, currentMillis takes on a value of 1001. 1001 - 0 is 1001, which is greater than 1000. So, previousMillis is assigned the value in currentMillis. That is previousMillis is assigned the value of 1001. The rest of the body of the if statement is also executed, and loop ends.

Next time, currentMillis is assigned a value of 1001. 1001 - 1001 = 0, so nothing happens. 999 milliseconds later, currentMillis is 2000. 2000 - 1001 = 999, so nothing happens. A millisecond later, currentMillis is 2001. 2001 - 1001 = 1000, so nothing happens. A millisecond later, currentMillis is 2002. 2002 - 1001 = 1001, which is greater than 1000, so previousMillis is assigned the value in currentMillis, 2002, the rest of the code in the if statement is executed, and the process repeats.

Now, one thing is obvious. That is, the if statement should be using >=, not >, so that the action occurs when currentMillis is 1000, 2000, 3000, etc., rather than 1001, 2002, 3003, etc.

If it takes the original value of "0" then the code makes sense

It does not, and if you read what I wrote above, it should be obvious why not.