Help with some programming!!

kurtselva:

UKHeliBob:
Put
Serial.begin(9600);in setup() and

Serial.println("Starting loop()");

Serial.print("setCounter = ");
Serial.println(setCounter);



as the first 3 lines in loop() and paste the output here.

May I know what is this supposed to do?

And by "paste the output here", which output are you referring to?

What I did was I just put the Serial.begin code in the setup and the 3 sentences in the loop..

One of the very few ways to debug code in the Arduino IDE is to print the value of variables to the Serial monitor at strategic points in the program so their value at that point can be seen. That was what I was suggesting you do. As to what output, I would have thought that it was obvious that I was referring to what you saw on the Serial monitor, but obviously I was not specific enough.