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