FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

button control problem

when i use a case structure with a notor set output the assigned button won't actavate the motor. what am i dooing wrong?

Johnny Caldwell
0 Kudos
Message 1 of 4
(3,513 Views)

When you say the assigned button won't activate the motor, does that mean you have Joystick button hooked up to the case structure? When you say activate the motor do you have values going into the motor? Is it in the "True" case? Could you post a JPG of a Vi? We need a little more info to figure this out.

Thanks

Joe V

FIRST Team 704 mentor

"Lockheed" Joe
Testing Blog"
0 Kudos
Message 2 of 4
(2,554 Views)

yes here is a portion of the codeNew Picture (1).jpg

Johnny Caldwell
0 Kudos
Message 3 of 4
(2,554 Views)

Your screenshot uploaded too small to really see what you're doing, but here are a few general suggestions.  First, use the LabVIEW debugging tools to see if you are properly checking the state of the joystick button.  Probe the wire going to the case structure - click on the wire while the code is running, then press the button and look at the probe.  Does it respond?

Second, be careful about putting on-off actions inside case structures.  Let's say you have a case structure that turns on a motor in the true case, and nothing in the false case.  You wire that to the joystick input.  Now, when you press the button the motor turns on, but it never turns off when you release the button because you don't have anything inside the false case.  If this is what you're doing, you should eliminate the case structure and connect the joystick output directly to the motor input.

0 Kudos
Message 4 of 4
(2,554 Views)