Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Help program. (http://www.chiefdelphi.com/forums/showthread.php?t=143934)

ICE_Bear 15-02-2016 20:44

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

cjl2625 15-02-2016 21:24

Re: Help program.
 
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

ICE_Bear 16-02-2016 17:45

Re: Help program.
 
How do you get to the joystick block?

Mark McLeod 16-02-2016 22:45

Re: Help program.
 
1 Attachment(s)
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.

ICE_Bear 17-02-2016 20:19

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

Mark McLeod 17-02-2016 21:45

Re: Help program.
 
1 Attachment(s)
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.

ICE_Bear 18-02-2016 21:00

Re: Help program.
 
What is the box at the bottom of the diagram labeled POV and how do you add it?

Mark McLeod 18-02-2016 21:24

Re: Help program.
 
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

ICE_Bear 19-02-2016 17:15

Re: Help program.
 
How do you connect the POV to PWM 4?

Alan Anderson 19-02-2016 19:34

Re: Help program.
 
Quote:

Originally Posted by ICE_Bear (Post 1542885)
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.

ICE_Bear 19-02-2016 20:01

Re: Help program.
 
Quote:

Originally Posted by Alan Anderson (Post 1542956)
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?

Alan Anderson 19-02-2016 21:25

Re: Help program.
 
1 Attachment(s)
Quote:

Originally Posted by ICE_Bear (Post 1542965)
how are you supposed to do that in Begin.vi?

Do it the same way you open any resource.

ICE_Bear 19-02-2016 21:42

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

Alan Anderson 19-02-2016 22:18

Re: Help program.
 
Quote:

Originally Posted by ICE_Bear (Post 1542996)
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?"

ICE_Bear 19-02-2016 22:40

Re: Help program.
 
Thank you for all your help. we just forgot to plug in the PWM.


All times are GMT -5. The time now is 07:47.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi