Quote:
Originally Posted by charlier999
The one problem with this code is that when i press the button longer than 1/50th of a second(50 cycles per second the rio reads the code), it hastily switches back and forth between on and off. Is there any way of fixing the problem or do i just need to have extremely fast fingers for that button.
Thx.
|
My code shouldn't do that. Notice how it sets a flag wasAPressed to make sure it doesn't continuously run shifting. Make sure wasAPressed is a member variable, not a local variable