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

node-red-node-pi-neopixel

v2.0.1

Published

A Node-RED node to output to a neopixel (ws2812) string of LEDS from a Raspberry Pi.

Downloads

136

Readme

node-red-node-pi-neopixel

A Node-RED node to drive a strip of Neopixel or WS2812 LEDs from a Raspberry Pi.

Pre-requisites

The Neopixel python driver need to be pre-installed... The easiest way to get the driver installed is to use the Unicorn HAT drivers install script... see the Pimoroni Getting Started with Unicorn HAT page.

curl -sS get.pimoroni.com/unicornhat | bash

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm install node-red-node-pi-neopixel

The data pin of the pixels should be connected to physical pin 12 - GPIO 18 of the Pi. Note: this may conflict with audio playback.

Usage

To set the background just set msg.payload to an html_colour name. Here is a list of html_colour names.

It also accepts a string triple rrr,ggg,bbb or #rrggbb

#### Bar Chart

Defaults style mode using configured foreground and background colours. The foreground colour is used to indicate the number of pixels or length required.

It accepts a number in msg.payload that can be either the number of pixels, or a percentage of the total length.

If you want to change the foreground colour, you can set msg.payload to a comma separated string of html_colour,length or length,html_colour. The foreground will then remain that colour until changed again.

Needle

It can also display a needle (single pixel) type gauge. The rest of the pixels are set to the background colour on one side, and the foreground colour on the other side of the indicated pixel.

If you want to change the needle colour, you can set msg.payload to a comma separated string of html_colour,length or length,html_colour.

Shift left and Shift right

You can also select shift modes where a single colour pixel is added to either the start or the end of the strip, shifting all the others along by one. In this mode the msg.payload can be specified as either an html colour name, an r,g,b triple or #rrggbb.

Low level "API"

The nth pixel of the string can be set by msg.payload with a CSV string n,r,g,b , where r, g and b are 0-255.

A range of pixels from position x to y can be set by msg.payload with a CSV string x,y,r,g,b

Brightness

The overall brightness of the pixels can be set to a level in the 0-100 range (0 being off, 100 being full brightness). It can also be set via msg.brightness The default level is 100 (full brightness)

Gamma correction

The node uses gamma correction to display colours as naturally as possible. This can be disabled if required. (e.g when working with low brightness levels)