Skip to content

rdepena/nerf-turret

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ©

About

NodeJS nerf turret api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published