View Single Post
  #6   Spotlight this post!  
Unread 21-03-2005, 21:07
dm0ney's Avatar
dm0ney dm0ney is offline
Will Code For Food (Food Optional)
AKA: Deepak Mishra
None #0217 (The ThunderChickens)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Shelby Twp., MI
Posts: 48
dm0ney will become famous soon enough
Send a message via AIM to dm0ney
Re: Programming motors with joystick buttons

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.
__________________

Alumni
Team #217, The ThunderChickens



Student, Class of 2009
California Institute of Technology