Re: how do I check for double button push on vex controller
So i understand that pseudocode. Two issues. in the first iff statement I am checking to see if the button is still pushed. I think that that state should be in the else because the condition where I have pressed once then pressed again to stimulate a special behavior is more restrictive.
The pseudocode for just that segment must be something like this:
IF (button pushed and released)
check to see if button is pressed again within a set amount of time (in my case if I were to press the button a second time, I would cause the lift to operate until a limit switch is activated - limit switch code is already done)
Else if (button pressed and held for a longer time)
Perform a standard function (in my case this would be to move the lift up until i release the button)
so you can see that there has to be some sort of timer to check against, but I can't get my head around the test that would allow me to check if a button were pressed then released then repressed and released. This is similar to a mouse double click on a computer, but not being a programmer per se, i don't know how that code works let alone knowing how to make it work in RobotC.