-
Notifications
You must be signed in to change notification settings - Fork 56
Aliases and defaults
All this can amount to a lot of typing, so BiblioPixel gives you some shortcuts.
If you are only specifying a typename
for a component, then you don't have to specify the entire dictionary, just the name of the class.
This means that a project
{"driver": {"typename": "bibliopixel.drivers.API.LPD8806.LPD8806"}}
is identical to the easier-to-read
{"driver": "bibliopixel.drivers.API.LPD8806.LPD8806"}
Aliases are just shorthand for some common classes. It lets you write the project
{"driver": "bibliopixel.drivers.API.LPD8806.LPD8806"}
as
{"driver": "LPD8806"}
You can find a current list list of the aliases in this file.
Aliases are case insensitive.
There are three command line flags that are used to fill in missing components in your project file - --driver
, --layout
, and --animation
.
You can either pass in an alias, or for more control, a JSON dictionary, which you will have to quote for your shell:
bibliopixel --animation=matrix_test
bibliopixel --layout='{"typename": "matrix", "width": 12, "height": 12}'
The SPI and Serial drivers require an "ledtype"
field to identify the hardware type of the LED - see LED Types. You can use the --ledtype
flag to enter this value from the command line as either a string or an integer.