nerf-turret

0.0.6 • Public • Published

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

License

MIT ©

Readme

Keywords

Package Sidebar

Install

npm i nerf-turret

Weekly Downloads

0

Version

0.0.6

License

MIT

Last publish

Collaborators

  • rdepena