Fork me on GitHub

NeoPixel LED strips

This library provides support for Adafruit Neopixel LED strips. See example usage video:

JAVASCRIPT API Reference api_neopixel.js

load("api_neopixel.js");

See on GitHub: api_neopixel.js


NeoPixel.create(pin, numPixels, order)

Create and return a NeoPixel strip object. Example:

let pin = 5, numPixels = 16, colorOrder = NeoPixel.GRB;
let strip = NeoPixel.create(pin, numPixels, colorOrder);
strip.setPixel(0 / pixel /, 12, 34, 56);
strip.show();

strip.clear();
strip.setPixel(1 / pixel /, 12, 34, 56);
strip.show();

strip.setPixel(i, r, g, b)

Set i-th's pixel's RGB value. Note that this only affects in-memory value of the pixel.

strip.clear()

Clear in-memory values of the pixels.

strip.show()

Output values of the pixels.