Various examples using the DualShock 4 controller
$ git clone https://github.com/itaisteinherz/ds-examples.git
$ cd ds-examples
$ yarn
Note that using npm instead of yarn currently fails because of an issue with node-hid
(I've already opened a PR to resolve this in node-dualshock-controller
- rdepena/node-dualshock-controller#82).
$ node index.js
If you connect the controller to your computer using bluetooth, you can only access the buttons and D-pads, which means you will only be able to run the basic.js
example.
To run the rest of the examples (flash.js
, light.js
, rumble.js
and touchpad.js
), connect the controller to your computer using a micro-USB cable, which will allow you to access the touchpad, the main LED of the controller and its rumble motors.
MIT © Itai Steinherz