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

pidee

v0.1.0

Published

Pidee Node.js Module ====================

Downloads

2

Readme

Pidee Node.js Module

Requirements

If you have not do so already, pidee-service needs to be installed and running on the Raspberry Pi.

Installing pidee-service

To install and run pidee-service first ssh into your Raspberry Pi then run the following commands:

sudo echo "deb http://pidee.theworkers.net/raspbian wheezy main" >> /etc/apt/sources.list
wget -qO - http://pidee.theworkers.net/pidee.public.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install pidee

How to use

npm install pidee

Adds the node pidee module from npm to your project.

API

pidee.on( domain, callback )

Listen for pidee change events. The domain can be: 'dip', 'button', 'dip.1', 'dip.2'. See domains for full list.

Example:

pidee.on( 'bottom', function ( value ) {
    // Button has changed
});

pidee.get( domain )

Returns a value on the pidee board. The domain can be: 'dip', 'button', 'dip.1', 'dip.2' etc. See domains for full list.

Example:
var value = pidee.get( 'dip.1' ) // return 0 or 1

pidee.set( domain, value )

Sets the value of the leds. The domain can be: 'led.yellow', 'led.green', 'led.blue'. See domains for full list.

Example:
`var value = pidee.get( 'led.yellow', true );

pidee.on( 'error', callback )

Listen to error events. The callback function should be in the form: function ( err, errorCode, message ). Without this errors will be thrown.

Example:

pidee.on( 'error', function ( err, errorCode, message ) {
    console.log( 'Pidee error:', err );
    console.log( 'Pidee error code:', code );
    console.log( 'Pidee error message:', message );
});

Example


var Pidee = require( 'pidee' );

var pidee = new Pidee();

pidee.on( 'error', function ( err, code, message ) {
    console.log( 'Pidee error:', err );
    console.log( 'Pidee error code:', code );
    console.log( 'Pidee error message:', message );
});

pidee.open( function () {

    // Turn on yellow led
    pidee.set( 'led.yellow', Pidee.ON );

    // Get the dip value
    var value = pidee.get( 'dip' );

    // Listen for button presses
    pidee.on( 'button', function ( value ) {
        console.log( 'Button changes', value );
    });

});

Domains

| Domain | Value Range | |-----------------|:-----------:| | all | | | led | [0,7] | | led.yellow | [0,1] | | led.green | [0,1] | | led.red | [0,1] | | dip | [0,255] | | dip.0 | [0,1] | | dip.1 | [0,1] | | dip.2 | [0,1] | | dip.3 | [0,1] | | dip.4 | [0,1] | | dip.5 | [0,1] | | dip.6 | [0,1] | | dip.7 | [0,1] | | button | [0,1] |

| Domain | GET | SET | ON | |---------|:--------:|:--------:|:-------------:| | led | | ✓ | | | dip | ✓ | | ✓ | | button | ✓ | | ✓ | | all | ✓ | | ✓ |