Home Elements Boards Recipes

APA102 Element

The APA102 Element implements using LED Stripes and LED panels based on the apa102 chip and protocol and provides some color animations and transitions.

These LED stripes and RGB LEDs are using a 2 wire interface with to sends RGB values with a 2-wire protocol using a clock and data line. They allow high transfer rates and reliable data transmission.

Multiple LEDs on a single data line are chained so the data goes through the first LED to the next one. Every LED is taking of the very first RGB value and passes on all the others.

Element Configuration

The following properties are available for configuration of the element.

datapin* – The GPIO pin that is used for data transmission to the first LED in the chain.

clockpin* – The GPIO pin that is used for clock signal to the first LED in the chain.

From the base Stripe Element implementation the following properties are available for configuration:

count – Number of pixels that are attached. The default is 8 and must be specified in the config only. The default is 1.

brightness – The brightness factor can be used to dim the light in general. The brightness value must be in the range 0…100. The default is 50.

value – Is used for color mode to pass a list of colors like red,blue,green,white. For valid color values, see LightElement.

mode – The effect to be used. See see StripeElement

duration in msecs – This parameter is used to specify the number you of milliseconds for a transition in a color animation or fading from one value to another. When not specified the value 0 is used to make the new value effective immediately.

From the base element implementation the following properties are available for configuration:

title – Caption text for the element. Used by the element specific cards on the dash boards.

description – A line of text that gives a short description of the device used in the web UI.

room – The location of the device.

loglevel – This property holds the element specific log level. The default value is LOGGER_LEVEL_ERR == 1.

startup – This property can be used to start the element using a different initialization phase. Possible values are “sys”, “net”, “time”. See The Startup sequence.

* This parameter must be specified.

Configuration Example

This example shows how to configure this element:

{
  "apa102": {
    "led": {
      "datapin": 40,
      "clockpin": 39,
      "count": 1,
      "brightness": "30",
      "value": "x203050"
    }
  }
}

Links

APA102 Vs. APA102C: https://forums.adafruit.com/viewtopic.php?t=66973

https://hackaday.io/project/21293-digital-led-display-apa107apa102ws2812bsk6812/

https://github.com/pololu/apa102-arduino/blob/master/APA102.h

// Copyright Pololu Corporation.  For more information, see http://www.pololu.com/

# pragma once

Tags

Element Light