LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get leap motion to control the direction of a motor with a h-bridge

Solved!
Go to solution

hi im doing a project in LabView with a leap motion controller to control a robotic arm and the direction that the user puts there hand it copies it. my question is how to put the leap as the controller and the parameters need to do it the code i have already done goes through a h-Bridge and arduino and can drive the motor by switching with a toggle switch. any help is much appreciated. the code is uploaded along with this. 

0 Kudos
Message 1 of 7
(3,235 Views)

I can't view your code since I don't have '16 installed on this PC, would it be possible for you to save back to an earlier version of the software? But from the sounds of it you have the motor under control, then all that is left is to interface with the Leap Motion.

 

Did you have any specific plans for this interaction? If you are unsure where to start then might I recommend this link which I found through a simple search of the NI website, seems like if you can figure that out then you should be able to do exactly what you want.

0 Kudos
Message 2 of 7
(3,092 Views)

hi thanks for the reply. ive already got the leap tool kit but unsure on how to make the leap the controller for the direction of the motor so if i go left the motor spins 1 way and then go right it spins the other way. i saved the code as 13.0

0 Kudos
Message 3 of 7
(3,086 Views)

Well you stated above that you have the ability to control the direction of motor already right? How do you do that?

You have the leap toolkit but are you able to read the position of your hand from it yet?

Then it is just a matter of linking the two, presumably using a scaling factor around some positional value.

0 Kudos
Message 4 of 7
(3,031 Views)

controlling the direction with a toggle switch connected to a case structure with the output numbers in the true or false cases. the number of the PWM output is in the case and that answer depending on the position of the toggle switch is fed into the pin selection

0 Kudos
Message 5 of 7
(3,024 Views)
Solution
Accepted by topic author colscanlon

So all you need to do is convert from the hand position values that you get from the leap. Given that you get an XYZ value, take the X value, set a threshold position.

If the X value is greater than the threshold the boolean is true, depending on how much greater it is then set the PWM.

Likewise if the Y value is below the threshold the boolean is false, depending on how much less is is then set the PWM.

Message 6 of 7
(3,020 Views)

thanks a million for all your help 

0 Kudos
Message 7 of 7
(3,017 Views)