Skip to content

Instantly share code, notes, and snippets.

View kalineh's full-sized avatar

kalineh

  • Funktronic Labs
  • Pasadena, CA
View GitHub Profile
anonymous
anonymous / ds4.cpp
Created December 17, 2015 19:00
example of using libhid to read and write a playstation DS4 controller (wired)
// quick hack job by @mmalex
// thanks to libhid author and @johndrinkwater and https://github.com/chrippa/ds4drv
#include <stdio.h>
#include "hidapi.h" // using http://www.signal11.us/oss/hidapi/
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
#pragma pack(push, 1)