Help program.

How do you program the POV on the Logitech joystick to move one motor using lab view?

On your joystick block, there should be an output for “POVs” which returns an array of integers. Index the first element of that array, and it’ll give you the angle that the POV is being pressed. If nothing is being pressed, the value is -1.

Up is 0
Right is 90
Down is 180
Left is either -90 or 270; I don’t remember

How do you get to the joystick block?

It’s one of the outputs available on the regular Joystick Get Values.
The same vi you use to get the axis and buttons in Teleop.vi.

POV.jpg


POV.jpg

How do you program the POV to move a motor up and down? sorry we don’t have much experience with lab view.

I don’t have a joystick with a HAT in the shop I’m in right now, so I won’t be able to test this until tomorrow at the earliest, but this is the idea.

POV-LV-sample.png


POV-LV-sample.png

What is the box at the bottom of the diagram labeled POV and how do you add it?

That’s not actually necessary.

It is called an indicator and just gives us a display on the front panel of the live values of POV when you run the code in Debug.

You get it by right-clicking on the wire or output node on the vi and choosing Create->Indicator

How do you connect the POV to PWM 4?

The snippet Mark posted shows how to control any motor you like. He called it “Motor 1” in his example. You can call it whatever you want in the string wired to the Refnum Get. Just Open it as PWM4 in Begin, and wire the device reference to a Refnum Set with the same name.

how are you supposed to do that in Begin.vi?

Do it the same way you open any resource.

put in Begin.png


put in Begin.png

Sorry if i came off rude. The program still isn’t working, is there anything we may not have done?

There are many things you might not have done. Instead of having us go through all the things detailed in the Screensteps documentation, though, how about you showing us what you have done? Posting your code for us to look at will be a lot faster than going back and forth with “did you do this? and this? and this too?”

Thank you for all your help. we just forgot to plug in the PWM.