Hello ladies and gentlemen :yikes: , our team wants to control a servo with the hat switch on top of the Logitech Extreme 3D Pro, but we’ve but attempting to program the hat switch for a week, we can use the servo with buttons, but we are stuck at trying to use the POVs for the hatswitch. any help or idea would be helpful.
POVs in LabVIEW have recently been made much simpler. The same way you would get the axes and buttons on a joystick, there should be a third output array on the Joystick Get vi for POVs. The POV you want will be the first (and only) element in the array. If you index the first element of that array, you will end up with a single integer value. IIRC that integer corresponds to the angle that the POV hat is at, with forward being 0* and CW+. Then you can either send that angle value directly to the servo if you have a 360* servo or use some kind of function to map POV inputs to servo angle outputs. Good luck!
Can you show us an example by chance? we still are having trouble, after reading your reply, Thanks!
My LabVIEW expired and I’m too lazy to put in the new activation code. Attached is a bad MS Paint drawing of what I think it looks like from memory.
Ok, I’ve tried this out with no luck, is there something I’m likely missing? I don’t know how to copy my code into Chief Delphi to show you.
You can either select the code you want and in one of the menus there’s an option like “Make PNG from selection” or you can just take a screen grab with any screen grabbing program.
Ok, we figured out my problem and got the code to work, although it goes back to the starting position when we let go of the hat switch, any ideas on how to make it stay in the same spot? thanks
How many places in your code do you set the value to the servo?
Presumably you set some value to the servo when the hat switch is depressed. i would look in the code for any other place where that servo is set and see how your code can reach that location (presumably by way of teleop.vi)
You probably need to incorporate a feedback node to remember the last value set.
Just how you do that depends on what your code looks like.
Another option is to put the servo.set command in a conditional statement and then only set it if the POV value is not -1. Then when the POV value is -1 the servo won’t get set to a new value and it will keep its last value.
Sorry for not replying for a while but, we’ve actually been able to get it working, if anyone wants to see how we did so, i can figure out how to send show to code, thanks for all the help!!