Skip to content

1000hz/neopixel-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NeoPixel LED Simulator

Here's a little simulator to help sketch out LED animation functions for one of these things: https://www.adafruit.com/products/2875

Usage

The library includes some LED Modules (currently only NeoPixelRing60). These accept a callback to run on each render tick. The callback is passed an array of blank Pixel(r,g,b,w) instances, and the current tick. It must return an array of Pixels to be rendered.

You'll also need to instantiate a Simulator class. Simulator constructors take LED Modules as arguments. After you've instantiated your Simulator, call simulator.start() to begin the light show.

const neopixel = new NeoPixelRing60((pixels, t) => {
  return pixels.map(p => new Pixel(255, 255, 255, Math.random()))
})

const simulator = new Simulator(neopixel)
simulator.start()

About

NeoPixel LED Simulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published