jclement / esp_lightingnado

ESP8266 MQTT based controller software for WS2812 LEDs
5 stars 4 forks source link

esp_lightingnado

I watched Sharknado 4 yesterday so, for some reason, lightingnado came to mind for a project name.

Dependencies

Pins

I'm using an ESP12E DEVKIT V2 (ESP + USB programmer board) so my pins correspond to that:

Controlling it

The device will connect to the configured MQTT server and operate on two topics.

Lighting Modes

The lighting mode is changed by pushing messages onto the control channel. The messages always start with a single character (because that scales...) that represents the target lighting mode and is followed by additional data (usually JSON) to pass into that lighting mode.

If the specific lighting mode is already active it'll perform an update on the lighting mode rather than switching to it. This allows for animated transitions between states within a lighting mode.

Ants

Marching ants. Sorta.. Takes an array of colors and then lays those out in a repeating pattern on the strip and then cycles them left or right.

A{
  "delay": 100,
  "colors": [
    [100,0,0],
    [0,100,0],
    [0,0,100]
  ],
  right: true
}

Percent

This one turns the lighting strip into a big progress bar. Changes are animated (both color and percent).

P{"percent":10, "color":[255,0,0], delay: 1}

Slide

This one isn't very exciting... It lights up a few lights in a particular color and then slides them left or right.

S{"delay": 100, "length": 5, "right": false, "color":[200,100,0]}

Twinkle

This one is a completely photo realistic 1 dimensional star field. Pixels light up randomly and then decay back to black. Oooh!

T{"delay": 10, "rate": 0.1, "decay": 5}

Rainbow

This one yields a pretty cycling rainbow

R{"delay": 10, "right": true, "step": 5, "brightness": 75}

Tracker

This lights up specified pixels and fades them out

K{"data": [1,2,3,100], "decay": 10, "color": [255,0,0]}