Code Monkey home page Code Monkey logo

dualshock4-python's Introduction

dualshock4-python

Use either pygame or pyUSB to read inputs from a PS4 dualshock 4 controller through USB connection

Author: Chi-Feng Pai ([email protected]) Platform: Win10 Python version: 3.6 Main imports: pygame (for joystic, button, and hat inputs) or pyusb+libusb (for gyroscope, accelerator, touch pad inputs)

Quick start:

  1. pip install pygame
  2. pip install pyusb
  3. pip install libusb
  4. Modify path to libusb-1.0.dll for backend in the example (e.g. C:\Users\Anaconda3\Lib\site-packages\libusb_platform_windows\x86\libusb-1.0.dll)
  5. Run the example to get readouts from your dualshock 4 controller

References:

  1. pygame: http://blog.mclemon.io/python-using-a-dualshock-4-with-pygame (Note that the gyroscope and accelerometer won't work if you follow the steps in this reference)
  2. pyUSB backend issue: https://c5techblog.wordpress.com/2016/09/05/tutorial-setup-pyusb-under-windows/
  3. Detailed mapping of readouts from dualshock 4: http://www.psdevwiki.com/ps4/DS4-USB
  4. Other useful resources: https://github.com/seidtgeist/node-ds4 and https://github.com/senceryazici/ps4controller/blob/master/ps4.py

dualshock4-python's People

Contributors

anubisankh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.