1.0.4 • Published 7 years ago
daydream-node v1.0.4
Daydream-node
Quick Node.js module to connect to the Daydream controller and receive all data.
Installation:
- Clone this repo and run:
npm install
node examples/simple.jsOR
npm install daydream-nodeUsage:
Make sure your Bluetooth connection is on.
var daydream = require('daydream-node')();
daydream.onStateChange(function(data){
if(data.isClickDown){
// do something
}
});Data available:
Buttons events:
// returns true if the button is clicked.
.isClickDown
.isHomeDown
.isAppDown
.isVolPlusDown
.isVolMinusDownOrientation:
// returns a float number with the orientation value for each axis.
.xOri
.yOri
.zOriAccelerometer:
// returns a float number with the accelerometer value for each axis.
.xAcc
.yAcc
.zAccGyroscope:
// returns a float number with the gyroscope value for each axis.
.xGyro
.yGyro
.zGyroTouch events:
// returns a floating number between 0 and 1 representing the position of the finger on the main button on the x and y axis.
.xTouch
.yTouchThis module was built based on @mrdoob's previous work on the same concept using Web Bluetooth.