View Single Post
  #7   Spotlight this post!  
Unread 07-02-2009, 13:57
domoarigato's Avatar
domoarigato domoarigato is offline
Team #1208 CCO
AKA: Coony
FRC #1208 (Metool Brigade)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: O'Fallon, Il
Posts: 32
domoarigato is an unknown quantity at this point
Re: Button Programming: Is this right?

Haha your code is a little messy... but basically, to clean that up, you should call all your "Motor: Open Jaguar" and such outside of the big case structure thing. (Ie. to the far left near the Joystick Opens). You can also close the motors easier outside of that case structure to help clean it up. (Also should get rid of those white/pink blocks that mean that the motors aren't being called in ever case of the structure.)

Attached is our main code... which isn't all that clean either but it works well enough. Basically what we have that is similar to your situation is when it's calling a motor outside the main case thing (the one with PWM 4) whichis then wired to a "Motor: Set Speed" inside a case structure that is wired to a button. In the true case (when the button is pressed) of the case structure, it will go full power (255) and the opposite in the false case (0). The motor is then closed outside that bigger case structure.

If that doesn't help, let me know.
Attached Thumbnails
Click image for larger version

Name:	buttons ex.jpg
Views:	112
Size:	111.7 KB
ID:	7351  
Reply With Quote