Skip to content

MultipleDriverProjects

Tom Swirly edited this page Jan 30, 2018 · 1 revision

Projects with multiple drivers.

An advanced project might need multiple drivers. This is accomplished with a separate drivers section, which is just a list of driver sections as above.

As a convenience, if both the driver and drivers sections are filled in, then the driver value is used as a set of default values for each driver in drivers. This avoids duplication in the common case where there are multiple drivers which only differ a bit.

Examples:

Here's a project which has multiple drivers and no driver section:

{
    "drivers": [
        {
            "typename": "serial",
            "width": 32,
            "height": 32,
            "ledtype": "LPD8806",
            "device_id": 10
        },
        {
            "typename": "serial",
            "width": 32,
            "height": 32,
            "ledtype": "LPD8806",
            "device_id": 11
        },
        {
            "typename": "serial",
            "width": 32,
            "height": 32,
            "ledtype": "LPD8806",
            "device_id": 12
        },
    ],

    "layout": "strip",
    "animation": "strip_channel_test"
}

Here's the same project written using the "driver" component to reduce duplication of common entries:

{
    "driver": {
        "typename": "serial",
        "width": 32,
        "height": 32,
        "ledtype": "LPD8806"
    },
    "drivers": [
        {"device_id": 10},
        {"device_id": 11},
        {"device_id": 12}
    ],
    "layout": "strip",
    "animation": "strip_channel_test"
}
Clone this wiki locally