View Single Post
  #8   Spotlight this post!  
Unread 10-02-2005, 13:17
Bleric's Avatar
Bleric Bleric is offline
Registered User
#0624 (CRyptonite)
Team Role: Programmer
 
Join Date: Jan 2005
Location: Houston
Posts: 19
Bleric is on a distinguished road
Send a message via AIM to Bleric Send a message via MSN to Bleric
Re: One button wonder

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.