From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Frc Progamming

How do i program the logitech joystick throttle axis to a motor

0 Kudos
Message 1 of 2
(3,155 Views)

There's a few steps that are true for programming all joysticks.  Start by plugging it in and opening up your driver station.  On the driver station, you'll find some tabs down the left side.  Click the one that looks like a USB connector's image and you'll see a listing of joysticks.

 

Here, you'll want to notice where your joystick is plugged in.  If it's the only one, I'd expect it to be USB0.  If that's the case, it's the default joystick from your begin.vi 

 

You've already determined you want to program an axis.  So, move that axis and notice which one is moving.  It'll have a number on it.  That's the number you're interested in.

 

Go to your teleop code and look for where the joysticks are pulled out.  It should leave with a thick orange and thick green wire.  The thick orange should be going into something called "Index Array."  If you hit ctrl+h and hover over it, you'll see that name pop up.  On the left side of that, right click the input and choose create->constant.  Put the number into the blue box that matches your axis.

 

From there, the rest of the code should already be in place.

 

If I didn't explain that well, let me know and I'll try another way.

0 Kudos
Message 2 of 2
(2,727 Views)