How to use the Leap Motion device in Python 3
The Leap Motion device reads hand positions and motions.
- Its software allows you to access those hand positions and motions in your Python program.
-
To visualize what that means,
see the Leap Motion home page
and run the demo on that page.
It shows the device in action.
To see what the Leap Motion device can do in Python:
- Visit the Leap Motion setup page
and download the setup file from the WINDOWS DOWNLOAD button.
- Run that setup file to install the Leap Motion drivers.
-
After running the setup file,
it probably opens the Leap Motion App Home,
which looks like this:
.
If the App Home is not open, open it by executing: C:\Program Files (x86)\Leap Motion\App Home\LeapMotionAppHome.
Once you have the App Home open,
try a demo (e.g. the Playground) to make sure that the device is working correctly.
-
If the device is NOT working correctly,
stop here and get help as needed.
- Download this zip file.
- Unzip it, placing its 4 files into the src folder of your project.
- Plug in the Leap Motion device (if you have not already done so).
- Run the Sample3.py file in the usual way.
- If all is well, it will print numbers on the Console indicating where your hands/fingers/etc are.
- Press Enter in the Console to exit the sample.
- Ask your instructor for help as needed in integrating the sample with your code.
After the above, you have the Leap Motion device working. Now, use its API
to apply it to your project!