ds4-rs 0.1.1

Read Dualshock4 controller data by using hidapi
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate ds4_rs;
extern crate hidapi;

use hidapi::HidApi;

/// This example is used to read dualshock4 data after playstation firmaware update 5.50
fn main() {
    let api = HidApi::new().expect("Failed to create HID API instance.");
    let controller = ds4_rs::get_device(&api).expect("Failed to open device");

    loop {
        let data = ds4_rs::read(&controller).expect("Failed to read data");
        println!("{:?}", data);
    }
}