FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the + knob on the joystick as the power setting for a motor?

I am coding an arm with a hook to climb the pyramid. Right now I was able to program the jaguar motor to go up at .5 power with button three on joystick, and go down with button 2 on joystick, at -.5 power. My question is I don't want a constant .5 power when I climb, sometimes if I'm short on time I'd like to be able to climb at 1 or -1 for example, but a button input is either on or off. I was wondering if there's a way to make it so when I click the 3rd button it makes the + button my vertical climb speed, but then when I release the 3rd button the + button doesn't do anything. Also if I where to click the 2nd button and use the + button as my vertical speed down, and when I release the 2nd button the + knob does nothing. If somebody knows how to do this, you'd make my day, thanks  A visual would be amazing.labview +.JPG

0 Kudos
Message 1 of 3
(3,966 Views)

The picture you posted seems pretty easy to add on to, so I'm not sure exactly what you're having trouble with.

Do you know how to add a third button to your array? Do you know how to add additional cases (Having 3 buttons means 8 different posibilities, including all combinations of 3 buttons pressed).

You mention both a + button and a + knob. Are you using two different terms for the same thing, or are they different concepts? Assuming you mean the thottle at the front of the base of the Attack 3 joystick, it is read as a joystick axis. Do you know how to read a joystick axis?

0 Kudos
Message 2 of 3
(2,865 Views)

I just mean the throttle on the base of the joystick, that has a + sign next to it. I know how to get the 3rd axis from the joystick which is the throttle's, I just don't know how to set it up so when I click button 3 it will enable the throttle to go from 0 to 1, but when I release button 3 it will disable the throttle and when I click button 2 it will enable the throttle to go from 0 to -1, and when I release it it will disable throttle. I was able to make what I have from watching youtube videos, I'm a newbie.

0 Kudos
Message 3 of 3
(2,865 Views)