View Single Post
  #2   Spotlight this post!  
Unread 23-02-2012, 16:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,062
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Time/timer function

Quote:
Originally Posted by DavisC View Post
I would like to use it so that when I press a joystick button, the button is disable for say 1 second (so that it only registers 1 press and not registering from consistent pressing).

Could demonstrate how this function works?
The boolean expression

(button_is_pressed && button_was_not_pressed_in_previous_iteration)

does what you want.

It's true only in the iteration immediately after the button is pressed, and doesn't become true again until the button is released and pressed again.


Reply With Quote