dualshock-controller version 0.6.2

I just released version 0.6.2 of the dualshock-controller library and I would like to showcase two features:

Sixaxis support:

The library now exposes the controller's gyro's via the "motion" events:

Code:

var dualShock = require('dualshock-controller')();
var johnny = require("johnny-five");
var board = johnny.Board({
        debug : true
    });
//set up the components once the board is ready.
board.on("ready", function () {
  servoX = new johnny.Servo({
    pin : 8
  });
  servoY = new johnny.Servo({
    pin : 10
  });
  dualShock.on('rightLeft:motion', function (data) {
    //lower resolution
    servoX.to(90 - (data.value * 0.75));
  });
 
  dualShock.on('forwardBackward:motion', function(data) {
    //lower resolution
    servoY.to(90 + (data.value * 0.75));
  });
  dualShock.connect();
});

Controller connected status and battery percent:

The library now exposes the controller's battery and connected status via the "change" events (make sure you have sound):

Code:

var dualShock = require('dualshock-controller')();
var say = require('say');
 
//connect the controller.
dualShock.connect();
 
//we will need a queue so all the statuses do not fire at once.
var voiceQueue = [];
var isSpeaking = false;
 
//queue a status.
var queueSpeak = function (phrase) {
    voiceQueue.push(phrase);
    proccessQueue();
};
 
//process the queued statuses.
var proccessQueue = function () {
    if (!isSpeaking) {
        isSpeaking = true;
        say.speak('Alex', voiceQueue.pop(), function () {
            isSpeaking = false;
            if (voiceQueue.length > 0) {
                proccessQueue();
            }
        });
    }
};
dualShock.on('battery:change', function (value) {
    queueSpeak('battery is ' + value);
});
dualShock.on('connection:change', function (value) {
    queueSpeak('connected via ' + value);
});