Skip to content

bottletechltd/daydream-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.js

OR

npm install daydream-node

Usage:

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
.isVolMinusDown

Orientation:

// returns a float number with the orientation value for each axis.
.xOri
.yOri
.zOri

Accelerometer:

// returns a float number with the accelerometer value for each axis.
.xAcc
.yAcc
.zAcc

Gyroscope:

// returns a float number with the gyroscope value for each axis.
.xGyro
.yGyro
.zGyro

Touch 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
.yTouch

This module was built based on @mrdoob's previous work on the same concept using Web Bluetooth.

About

Quick Node.js module to connect to the Daydream controller and receive all the data

Resources

License

Stars

0 stars

Watchers

3 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%