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

pilite

v1.0.0

Published

PiLite API module for programming in node.js

Downloads

4

Readme

pilite

PiLite API module for programming in node.js.

The API mostly mirrors the functionality provided by the serial communications but with handy methods and value validations. The source code isn't complicated and will help you better understand how it works.

What's a piLite?

It's a credit card sized pcb that snugly fits on top of a Raspberry Pi.

Ciseco piLite

See [Using the Pi-Lite pre-loaded software](http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/280#Using the Pi-Lite pre-loaded software) for the commands that are used with this module.

Getting Started

First of all, run through the piLite setup instructions before plugging it in

Not got node installed on your Pi? Check out the install instructions for the Raspberry Pi - you don't need to npm install serial as it's included in this module.

Install the module with: npm install pilite

var pilite = require('pilite');
pilite.connect(function() {
	// Run piLite commands
}

Example

var pilite = require('pilite');

pilite.connect(function() {
	pilite.clear();
	
	// Toggles a random pixel twice a second.
    var timer = setInterval(function() {
        column = 1 + Math.floor(Math.random() * 14),
        row = 1 + Math.floor(Math.random() * 9);

        pilite.pixel(column, row, "TOGGLE");
    }, 500);
});

API methods

Please read the source code to get a better understanding of each of these methods, what's expected in the parameters is documented there. The unit tests are also useful to this end.

setSpeed(value, options)

Set scrolling delay in ms 1 is scrolling very fast, 1000 is scrolling very slow. Default speed is 80.

frameBuffer(value, options)

Sets a frame instantly in one go. This is the most efficient method of updating the state of the PiLite if you want to do animations or multiple state changes at once without a bit of lag.

Using a 126 character string in ones and zeros to represent each LED state (on or off)

barGraph(column, value, options)

Sets a column to a percentage

chart(data, options)

Create graph from an array (max 14 columns)

vuMeter(row, value, options)

vuMeter - Horizontal bar graph

pixel(column, row, action, options)

Set a pixel's state

all(value, options)

Set all the pixels on or off

'clear(options)'

Turns all pixels off - Alias to ALL,OFF

'scroll(value, options)'

Scroll value columns left (+) or right (-)

text(column, row, character, options)

Display character at location x,y.

write(data)

Writes commands to the serial to instruct the Pi Lite. You can use this to pass text to scroll.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Credits

Fabrizio Codello's Example Gist provided the basis for this module.

Release History

  • 0.1.1 - pilite-padawan
  • 0.1.0 - First stable release
  • 1.0.0 - Fixed API and export the Pilite module directly

License

Copyright (c) 2013 Andrew Goodricke
Licensed under the MIT license.