Quote:
|
Originally Posted by stephenthe1
hey,
I always wandered, when you press a button on a joystick (say the top button or trigger), does it "remember" it was pressed and hold a value of 1? I don't really understand this. otherwise, for the guy who posted this forum, he would have to be holding down the trigger, which seems like it would be problematic. do you know what I mean? how does that work.
|
When a button is pressed on a joystick, it is not remembered. If the motor was to be driven for some time and the user did not want to hold the button until the desired point, a flag would have to be used.
The flag would be set to one when the button is pressed which would enable code controlling relay ouputs or pwms. Once a desired outcome happens, the flag would have to be reset. The outcome could be a pot position being reached, an encoder count value, a set amount of time from either Kevin's clock or a clock variable incremented every program cycle, or even the ORIGINAL BUTTON pressed on the joystick.