NodeJS nerf turret api
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.editorconfig
.gitattributes
.gitignore
.jshintrc
.travis.yml
.yo-rc.json
Gruntfile.js
README.md
index.js
null.js
package.json

README.md

NodeJS nerf turret api

Compatible with the Dream Cheeky 908 model.

Install

$ npm install --save nerf-turret

Usage

var nerfTurret = require('nerf-turret'),
  turret = new nerfTurret.Turret();

  turret.on('ready', function () {
    turret.left();
    setTimeout(turret.stop, 500);
    setTimeout(turret.fire, 500);
    //possible commands are:
    //turret.left();
    //turret.right();
    //turrent.up();
    //turret.down();
    //turret.stop();
    //turret.fire();
    
  });
  
  

Pairing with a remote turret: You can use a socket.io server to pair with a remote turret, you will need a listener script connected to both the socket and the turrent and a remote script connected to the socket: Example Listener:

var nerfTurret = require('nerf-turret'),
  turret = new nerfTurret.Turret({
    socketServer:'http://localhost:9000/',
    listening: true
  });

  console.log('I am listening');

Example remote turret usage:

var nerfTurret = require('nerf-turret'),
  turret = new nerfTurret.Turret({
    socketServer:'http://localhost:9000/'
  });

  turret.on('ready', function () {
    turret.left();
    setTimeout(turret.stop, 500);
    setTimeout(turret.fire, 500);
  });

Office Turret Bot video

Nerf Turret

<iframe src="//player.vimeo.com/video/122693852" width="500" height="375" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

License

MIT ©