Skip to content

OPP LEDs

Related Config File Sections:

OPP hardware can directly drive LED strips. This features is currently being developed. Documentation will be added as the feature becomes more mature.

LEDs work similar to matrix lights (chain 0, board 1, LED 1):

lights:
  some_led:
    number: 0-1-1
    subtype: led
    type: rgb

Note, counting starts always with 0, so LED 1 in aboves example is the 2nd LED of the strip.

Overview video about serial LEDs:

Channel and Number Syntax

In MPF lights abstract a light source which emits arbitrary colors. However, this is not true for all real lights. Some support only white (GIs), others only a single-color (i.e. red inserts) and others support full RGB. For that reason MPF knows light numbers and channel numbers. Internally, a light consists of one or multiple channels. For instance, a single-color GI will contain a single white channel. While a RGB light will control a red, green and a blue channel. A white light behind a red insert should be a single red channel (because it cannot emit other colors through the red insert). You can configure those channels using the channels setting or use start_channel and type to define the channels. See /mechs/lights/index for details.

However, in most cases a platform supports one type of lights (per subtype) this would be overly verbose and we added the number setting for configuring lights in the common platform way. For instance a platform for GIs will configure single channel white lights or a serial LED controller will configure RGB lights with three channels.

OPP assumes RGB lights by default. For everything else (i.e. RGBW) you have to use channels.

Light Numbers

OPP numbers use the format: serial_chain-card_num-index

chain_serial is only relevant if you got multiple chains connected via USB. See /mechs/lights/ws2812 for details about chains. If you only got one chain you can omit this part and your format becomes card_num-index.

card_num is the index of the board on the chain. As the first board is always at addr 0x20 you can calculate the addr using 0x20 + card_num. If you only got one board you can omit the board and your format becomes just index`.

For instance, 0-0-0 for the first RGB LED on chain 0 on card 0x20. In this case you can also use 0-0 or 0 (channel 0-2). 0-0-1 or 0-1 or 1 is the second LED on the chain (channels 3-5).

3-2-6 is the 6th LED on board 2 (addr 0x22) of chain 3 (channels 18-20).

Channels

OPP channels use the format: serial_chain-card_num-internal_index

This is mostly the same as numbers above except that internal_index = 3 * index. This is because serial LEDs are traditionally RGB (or GRB) LEDs with exactly three channels. However, this is not true for RGBW or similar LEDs which do not work with this style of numbering. Luckily, you can chain them instead and have MPF calculate the internal channels for you:

lights:
  led_0:
    start_channel: 0-0-0
    subtype: led
    type: rgb    # will use red: 0-0-0, green: 0-0-1, blue: 0-0-2
  led_1:
    previous: led_0
    subtype: led
    type: rgbw   # will use red: 0-0-3, green: 0-0-4, blue: 0-0-5, white: 0-0-6
  led_2:
    previous: led_1
    subtype: led
    type: rgbw   # will use red: 0-0-7, green: 0-0-8, blue: 0-0-9, white: 0-0-10

See WS2811 and WS2812 LEDs in Pinball for details.

What if it did not work?

Have a look at our OPP troubleshooting guide.


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results