npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rover-2

v0.2.0

Published

A node.js client for controlling the Brookstone Rover 2.0

Downloads

2

Readme

rover-2

Implementation of TCP network protocols for the Brokstone Rover 2.0. Note that all rover commands require a connection to the rover wifi network, typically beginning with ROVER.

Attempts to expose all functionality of the rover with an easy to use API.

This module is still under heavy development. Pull-requests are welcome.

Installation

Install via git:

$ npm install rover-2

REPL

rover-2 exposes a repl.js file for testing. Currently the exposed locals include:

  • rover: outward facing api object
  • utils: byte utility functions
  • blow: blowfish implementation

For example:

$ ./repl.js 
rover> rover
{ connect: [Function: connect],
  disconnect: [Function: disconnect],
  forwardLeft: [Function: forwardLeft],
  forwardRight: [Function: forwardRight],
  reverseLeft: [Function: reverseLeft],
  reverseRight: [Function: reverseRight],
  forward: [Function: forward],
  reverse: [Function: reverse],
  cameraUp: [Function: cameraUp],
  cameraDown: [Function: cameraDown],
  cameraStop: [Function: cameraStop],
  spin: [Function: spin] }

Usage

Require and go:

// Require rover
var rover = require('rover-2');

// Establish connection, then send some commands
rover.connect()
    .then(function () {
        console.log('sending forward');
        return rover.forward(1000);
    })
    .then(function () {
        console.log('stopping');
        return rover.stop();
    })
    .then(function () {
        console.log('sending reverse');
        return rover.reverse(1000);
    })
    .then(function () {
        console.log('spinning');
        return rover.spin('clockwise', 1000);
    })
    .catch(function (err) {
        console.log('failed: ', err);
    });

API

rover.connect([callback])

Establishes connection to rover. Requires connection to rover network.

  • callback: [Optional] function to deliver connection error

rover.disconnect()

Closes connection with rover. Any subsequent commands will throw an error, with the exception of connect.


rover.forwardLeft([duration])

Instructs the rover to move the left track forward. Seems to persist for one second with a single instruction.

  • duration: [Optional] ms to continue sending instruction

rover.forwardRight([duration])

Instructs the rover to move the right track forward. Seems to persist for one second with a single instruction.

  • duration: [Optional] ms to continue sending instruction

rover.reverseLeft([duration])

Instructs the rover to move the left track backward. Seems to persist for one second with a single instruction.

  • duration: [Optional] ms to continue sending instruction

rover.reverseRight([duration])

Instructs the rover to move the right track backward. Seems to persist for one second with a single instruction.

  • duration: [Optional] ms to continue sending instruction

rover.stopLeft()

Instructs the rover to stop left track movement.


rover.stopRight()

Instructs the rover to stop right track movement.


rover.forward([duration])

Instructs the rover to move both tracks forward. Seems to persist for one second with a single instruction.

  • duration: [Optional] ms to continue sending instruction

rover.reverse([duration])

Instructs the rover to move both tracks backward. Seems to persist for one second with a single instruction.

  • duration: [Optional] ms to continue sending instruction

rover.stop()

Instructs the rover to stop all track movement.


rover.cameraUp()

Instructs the rover to raise the camera. Will continue until told to stop or reaches highest point.


rover.cameraDown()

Instructs the rover to lower the camera. Will continue until told to stop or reaches lowest point.


rover.cameraStop()

Instructs the rover to stop all camera movement.


rover.spin([direction,][duration])

Instructs the rover to spin.

  • direction: [Optional] direction of spin ('clockwise' or 'counter-clockwise'), defaults to 'clockwise'
  • duration: [Optional] how long to continue spin