|
Re: Single Click On/Off Using the Trigger in EasyC
You don't really want to toggle the state of the lights when the trigger is active. You want to toggle when the trigger becomes active. You need to keep track of whether or not the trigger is pressed, and only do the toggle action when it is pressed now, but was not pressed last time.
The code bear24rw posted is a good example of how to do it.
|