Any of the above code segments will work =P
Hmm... come to think of it, you're right russell. latch++ doesn't really do anything
In the original code, we didn't have "latch=1" at the end of the first if statement. Meaning, latch would count the number of cycles we'd held the button down. "if(latch==1)" made sure we only executed that bit of code on the
first loop we'd held the button.
Later, we added latch=1 to make sure that variable wouldn't wrap around to zero after 32,767 loops
That being said... I'll take out that "latch++" stuff as soon as I can get my hands on the code.
