Linux library to controll the Dualshock 4 (PS4 Controller)
C Objective-C Makefile
Latest commit ba3ceca Jan 5, 2017 @j0lama committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
.gitignore Initial commit Nov 18, 2016
Makefile
README.md Update README.md Jan 5, 2017
buttons.c
buttons.h Add files via upload Nov 18, 2016
controller.c Add files via upload Dec 13, 2016
controller.h
ds4.c
ds4.h Add files via upload Dec 13, 2016
ds4_sample.c Add files via upload Nov 18, 2016
sample_ds4_buttons.c Add files via upload Dec 13, 2016
sample_ds4_joysticks.c Add files via upload Dec 13, 2016
sample_ds4_mouse.c
touch_pad.c
touch_pad.h Add files via upload Dec 13, 2016

README.md

DS4Lib 1.0

Introduction

This is a simple Linux library written to control the Dualshock 4 through USB.

This library reads the data from a temporal file created in /dev/input/ when you plug in the DS4.

Functions

All functions are in ds4.h.

Include this file to your proyect to be able to use DS4Lib.

Functions:

  • DS4_CONTROLLER * ini_DS4();

  • int free_DS4(DS4_CONTROLLER * ds4);

  • int button_pressed(DS4_CONTROLLER * ds4, int Button);

  • int ds4_update_status(DS4_CONTROLLER * ds4, char * data);

  • int ds4_print_status(DS4_CONTROLLER * ds4);

  • int ds4_get_joyL_hor(DS4_CONTROLLER * ds4);

  • int ds4_get_joyL_ver(DS4_CONTROLLER * ds4);
  • int ds4_get_joyR_hor(DS4_CONTROLLER * ds4);
  • int ds4_get_joyR_ver(DS4_CONTROLLER * ds4);

  • int ds4_get_tpad_coord(DS4_CONTROLLER * ds4);*

This version

DS4Lib 1.0 adds touchpad tracking. You can get the status of the new pressable buttons (TPAD_CLICK, TPAD_TOUCH) declared in buttons with the usual button_pressed() function. You can also retrieve the coordinates of your finger on the touchpad with the new 'ds4_get_tpad_coord(DS4_CONTROLLER * ds4)' function.

Touchpad-coordinates: (adjust at your will. Take into account touchpad, dimensions (52mmx23mm (external approximately))[source: http://www.psdevwiki.com/ps4/DualShock_4];

      x-axis         

0_ _ _ _ _ _ _ _ _ _ _ _255

y|_ _ _ _ _ _ _ _ _ _ _|

-|_ _ _ _ _ _ _ _ _ _ _|

a|_ _ _ _ _ _ _ _ _ _ _|

x|_ _ _ _ _ _ _ _ _ _ _|

i|_ _ _ _ _ _ _ _ _ _ _|

s|_ _ _ _ _ _ _ _ _ _ _|

255_ _ _ _ _ _ _ _ _ _ _ _

In future versions DS4Lib will include tracking of gyroscope/accelerometer values in real time.

Changelog

DS4Lib 1.0: Adds Touchpad tracking

DS4Lib 0.9: Adds Joystick tracking.

  • Tracking of all buttons and Joysticks.

DS4Lib 0.5: Initial release.

  • Tracking of all buttons.

Contributors

j0lama: Buttons and Joysticks tracking.

s0cKrate5: TouchPAD tracking.