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

locorobo

v1.2.0

Published

LocoRobo Control for Node.js

Downloads

16

Readme

api-node

LocoRobo Control for Node.js

Install

$ npm install --save api-node

Installation Special Cases

The library we use for serial communication requires special build tools to be installed on your computer. The following contains instructions taken from the serialport library.

This assumes you have everything on your system necessary to compile ANY native module for Node.js. This may not be the case, though, so please ensure the following are true for your system before filing an issue about "Does not install". For all operatings systems, please ensure you have Python 2.x installed AND not 3.0, node-gyp (what we use to compile) requires Python 2.x.

Windows:

  • Windows 7 or Windows 8.1 are supported.
  • Install Visual Studio Express 2013 for Windows Desktop.
  • If you are hacking on an Arduino, be sure to install the drivers.
  • Install node.js 0.10.x matching the bitness (32 or 64) of your operating system.
  • Install Python 2.7.6 matching the bitness of your operating system. For any questions, please refer to their FAQ. Default settings are perfect.
  • Open the 'Visual Studio Command Prompt' and add Python to the path.

Mac OS X:

Ensure that you have at a minimum the xCode Command Line Tools installed appropriate for your system configuration. If you recently upgraded the OS, it probably removed your installation of Command Line Tools, please verify before submitting a ticket.

Desktop (Debian/Ubuntu) Linux:

You know what you need for you system, basically your appropriate analog of build-essential. Keep rocking! Ubuntu renamed the node binary nodejs which can cause problems building node-serialport. The fix is simple, install the nodejs-legacy package that symlinks /usr/bin/nodejs => /usr/bin/node or install the more up to date nodejs package from Chris Lea's PPA.

# Ubuntu node
sudo apt-get install nodejs nodejs-legacy

# Or Chris Lea's PPA Node (more up to date)
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

sudo apt-get install build-essential
npm install locorobo

Raspberry Pi Linux:

  • Starting with a a vanilla New Out of the Box Software (NOOBS) Raspbian image (currently tested: 5/25/2013)
  • Log into your Raspberry Pi through whatever means works best and ensure you are on a terminal prompt for the remaining steps. This could be local or through an SSH (or a serial connection if you like).
  • Issue the following commands to ensure you are up to date:
   sudo apt-get update
   sudo apt-get upgrade -y
  • Download and install node.js:
   wget http://nodejs.org/dist/v0.10.12/node-v0.10.12-linux-arm-pi.tar.gz
   tar xvfz node-v0.10.12-linux-arm-pi.tar.gz
   sudo mv node-v0.10.12-linux-arm-pi /opt/node/
  • Set up your paths correctly:
   echo 'export PATH="$PATH:/opt/node/bin"' >> ~/.bashrc
   source ~/.bashrc
  • Install using npm, note this will take a while as it is actually compiling code and that ARM processor is getting a workout.
   npm install locorobo

Usage

var api = require('locorobo-node');
return api.start('/dev/tty.usbmodem1')
        .then(function(){
            return api.startScanning(500)
        })
        .then(api.getRobots)
        .then(function(robots){
            return robots[Object.keys(robots)[0]];
        })
        .call('connect')
        .call('activate')
        .call('allLights', api.Color.MidnightBlue)
        .call('move', api.MotorDirection.Forward, api.MotorDirection.Backward, 1, 1)
        .delay(2000)
        .call('kill')
        .delay(500)
        .call('disconnect')