Log in

View Full Version : Need help on program please


MechaKnight996
05-02-2014, 19:41
Okay, so i am nearing completion of my code but I need to make a motor spin when i press a button on the joystick and I'm not sure how. If anyone can help please post a response.

ehochstein
05-02-2014, 19:46
Could you give us some more information? What language are you programming in? What motor controllers are you using? Can you post any portion of your code that you are having issues with?

apalrd
05-02-2014, 19:48
What language are you using?

In LV, you could do something like this:

MechaKnight996
05-02-2014, 19:51
Im using labview, and i need it to run from a joystick button.

MechaKnight996
05-02-2014, 19:59
Thank you for your help, it works now.

apalrd
05-02-2014, 20:09
No problem!

There are a lot of ways to do it (that is only one, but it's probably the easiest), but however you do it, you can only have one Set Motor for each motor in teleop, otherwise they will 'fight' with each other.

MechaKnight996
05-02-2014, 20:20
how would i run 2 seprate motors?

apalrd
05-02-2014, 20:23
You would write separate code for each motor.

If you have more than one 'Set Motor' for a single motor, then the value will be set to both values, and one of them will 'win'. Which one exactly is random.

You can still have multiple 'Set Motor' calls in Teleop, as long as there is only one per motor.