led_rings

Config File Section

Valid in machine config files YES
Valid in mode config files NO

New in version 0.31.

A “led_rings” will create “count” leds for you starting the number at “number_start”. If you need a prefix or suffix for the number you can use “number_template”. All settings in “led_template” will be applied to all LEDs. The only difference between led_stripes and led_rings is how the x/y coordinates are computed.

Here’s an example:

#config_version=4

led_stripes:
  stripe1:
    number_start: 10
    led_template:
      tags: test
    count: 5
    debug: True
  stripe2:
    number_start: 200
    number_template: 7-{}
    count: 5
    direction: 90
    start_x: 10
    start_y: 20
    distance: 5
    debug: True

led_rings:
  ring1:
    number_start: 20
    count: 12
    radius: 3
    start_angle: 90
    center_x: 100
    center_y: 50
    debug: True

number_start:

The integer value for the number for the first LED in the ring. (MPF assumes that all the LEDs in the ring are numbered sequentially.)

count:

The integer value for how many LEDs are in the ring.

number_template:

MPF automatically configures the LEDs in a ring. The first one uses the number_start: value, and then it counts up from there up through the count: value.

However, many hardware numbers for LEDs are not just vanilla numbers, rather they also include a board number or channel or something like that. The number_template: is where you specify what that number value looks like. Just use braces {} for the part you want replaced by a number.

The example config with a number template of 7-{} with a number start of 200 and a count of 5 will create 5 LEDs with the numbers 7-200, 7-201, 7-202, 7-203, and 7-204.

center_x:

The “x” position of the center of the ring. (This is not used in MPF yet.)

center_y:

The “y” position of the center of the ring.

start_angle:

The angle (in degrees, 0-360) of the first LED in the right. This is used for the calculation of x/y positions of individual LEDs only.

radius:

The radius of the ring (in relative size to the x/y coordinates of the center_x: and center_y: positions. This is used for the calculation of x/y positions of individual LEDs only.

led_template:

This is a list of sub-settings (indented) that are regular settings from the leds: section of your machine config. Any settings that are valid there are valid here, and they’re applied to all the LEDs in the ring.