this is the node js package for using psvr.
npm install psvr
var PSVR = require("psvr");
var device = new PSVR();
device.on("data", function(data) {
console.log(data);
});
var device = new PSVR();
data
- Object - the data read from the device
{
"yawAccel": -1,
"pitchAccel": -1,
"rollAccel": -1,
"yaw": -66,
"pitch": 64,
"roll": 2,
"xAccel": 0,
"yAccel": -1,
"zAccel": 64,
"isWorn": false,
"isDisplayActive": true,
"isEarphoneConnected": false,
"mute": false,
"volume": 16
}
rawData
- Buffer - the data read from the device
JSON.stringify(rawData);
{
"type": "Buffer",
"data":[0,0,16,0,10,4,32,0,2,34,1,255,127,0,0,0,26,112,58,0,13,0,0,0,24,0,81,63,31,2,177,20,14,114,58,0,8,0,10,0,18,0,129,63,111,2,209,20,34,1,0,0,0,3,255,115,0,0,0,0,0,254,1,49]
}
error
- The error Object emitted
emitted when device is connected.
emitted when device is disconnected.
emitted when device is worn.
emitted when device is dropped.