<commit_before># Node Pixel

![](https://img.shields.io/npm/v/node-pixel.svg)
[![Join the chat at https://gitter.im/ajfisher/node-pixel](https://img.shields.io/badge/Gitter-Join%20Chat-brightgreen.svg)](https://gitter.im/ajfisher/node-pixel?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![](https://img.shields.io/david/ajfisher/node-pixel.svg)
![](https://img.shields.io/github/issues/ajfisher/node-pixel.svg)
[![Coverage Status](https://coveralls.io/repos/github/ajfisher/node-pixel/badge.svg?branch=master)](https://coveralls.io/github/ajfisher/node-pixel?branch=master)
[![Travis](https://img.shields.io/travis/ajfisher/node-pixel.svg)]()

The purpose of this library is to provide a node js interface for addressable
RGB LEDs. Most commonly these are known as Neo Pixels (if you shop at Adafruit)
however any WS2812b addressable LED should work with this library.

The current iteration supports two methods of set up:

* a custom version of firmata that provides an interface to talk to the "pixels".
* an I2C "backpack" using an arduino pro mini or nano that provides the interface
and control of the pixels and then the IO controller talks to this backpack over
I2C messages.

The pixel library can be used with both Johnny-Five or stock Node Firmata and
can be used by any board that provides an IO interface with I2C support such as
a Raspberry PI.

Both fimwares are provided in this repo in the
[firmware/build](firmware/build) directory.

## Getting help

If you need some help getting your pixel strip working with johnny five jump into
the [Gitter Chat](https://gitter.im/ajfisher/node-pixel) or reach out to
[ajfisher on twitter](http://twitter.com/ajfisher) or just raise an
[issue here.](https://github.com/ajfisher/node-pixel/issues)

## Installation

Installation of both backpack and custom firmata are covered in detail in the
[Installation Guide](docs/installation.md).

Short version for node-pixel custom firmata.

```
npm install node-pixel
npm install -g nodebots-interchange
```

Plug in your arduino

```
interchange install git+https://github.com/ajfisher/node-pixel -a uno --firmata
```

### A note on multiple strips

Multiple led strips on one arduino or backpack are supported up to a maximum
of 8 individual strips (8 pins in use at once). Each strip can be different
lengths but you can only have a maximum of 192 pixels for Firmata and about
500 pixels for the backpack version.

Multiple strips connected to a single board or backpack are for the purposes
of node-pixel considered to be a single strip and are joined together in sequence
in the order that you define them.

On a backpack, the strips are defined sequentially from pin 0-7 on the backpack.

On an arduino, each strip can be defined with an individual pin which doesn't
need to be sequential (eg you can use pin 3, then pin 9, then pin 7).

One thing to note is that the timings on these strips are quite tight and you
will reach an upper limit of how much data you can push to the board controlling
the pixels (all that RGB data going over the wire) and the sheer number of
pixels you can refresh quickly (each pixel is written "in turn"). As such,
you may run into some blocking conflicts. These are discussed in
[this issue](https://github.com/ajfisher/node-pixel/issues/15).

# Pixel API

The Pixel API is provided below.
<commit_msg>docs: Updated readme to provide extra help for windows users. Fixes #182 (#183)<commit_after># Node Pixel

![](https://img.shields.io/npm/v/node-pixel.svg)
[![Join the chat at https://gitter.im/ajfisher/node-pixel](https://img.shields.io/badge/Gitter-Join%20Chat-brightgreen.svg)](https://gitter.im/ajfisher/node-pixel?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![](https://img.shields.io/david/ajfisher/node-pixel.svg)
![](https://img.shields.io/github/issues/ajfisher/node-pixel.svg)
[![Coverage Status](https://coveralls.io/repos/github/ajfisher/node-pixel/badge.svg?branch=master)](https://coveralls.io/github/ajfisher/node-pixel?branch=master)
[![Travis](https://img.shields.io/travis/ajfisher/node-pixel.svg)]()

The purpose of this library is to provide a node js interface for addressable
RGB LEDs. Most commonly these are known as Neo Pixels (if you shop at Adafruit)
however any WS2812b addressable LED should work with this library.

The current iteration supports two methods of set up:

* a custom version of firmata that provides an interface to talk to the "pixels".
* an I2C "backpack" using an arduino pro mini or nano that provides the interface
and control of the pixels and then the IO controller talks to this backpack over
I2C messages.

The pixel library can be used with both Johnny-Five or stock Node Firmata and
can be used by any board that provides an IO interface with I2C support such as
a Raspberry PI.

Both fimwares are provided in this repo in the
[firmware/build](firmware/build) directory.

## Getting help

If you need some help getting your pixel strip working with johnny five jump into
the [Gitter Chat](https://gitter.im/ajfisher/node-pixel) or reach out to
[ajfisher on twitter](http://twitter.com/ajfisher) or just raise an
[issue here.](https://github.com/ajfisher/node-pixel/issues)

## Installation

Installation of both backpack and custom firmata are covered in detail in the
[Installation Guide](docs/installation.md).

Short version for node-pixel custom firmata.

```
npm install node-pixel
npm install -g nodebots-interchange
```

Plug in your arduino

```
interchange install git+https://github.com/ajfisher/node-pixel -a uno --firmata
```

Note that on windows, you may need to explictly pass a port to flash due to the
way com ports work. eg:

```
interchange install git+https://github.com/ajfisher/node-pixel -a uno -p COM3 --firmata
```

### A note on multiple strips

Multiple led strips on one arduino or backpack are supported up to a maximum
of 8 individual strips (8 pins in use at once). Each strip can be different
lengths but you can only have a maximum of 192 pixels for Firmata and about
500 pixels for the backpack version.

Multiple strips connected to a single board or backpack are for the purposes
of node-pixel considered to be a single strip and are joined together in sequence
in the order that you define them.

On a backpack, the strips are defined sequentially from pin 0-7 on the backpack.

On an arduino, each strip can be defined with an individual pin which doesn't
need to be sequential (eg you can use pin 3, then pin 9, then pin 7).

One thing to note is that the timings on these strips are quite tight and you
will reach an upper limit of how much data you can push to the board controlling
the pixels (all that RGB data going over the wire) and the sheer number of
pixels you can refresh quickly (each pixel is written "in turn"). As such,
you may run into some blocking conflicts. These are discussed in
[this issue](https://github.com/ajfisher/node-pixel/issues/15).

# Pixel API

The Pixel API is provided below.

{'fraction_non_alphanumeric': 0.08435626605766486, 'fraction_numerical': 0.007850413930916357, 'mean_word_length': 4.495686274509804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 27, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1287233', 'n_tokens_mistral': 2158, 'n_tokens_neox': 2004, 'n_words': 916}