Set brightness?

How do I define the brightness in a yaml file? Google fu said something about layout section, but when looking for a layout section in the documentation it only mentions: “Needs to be done” which is not really helpful LOL.

Just add brightness: <0-255> to your layout section in the project file where the value is 0 (off) to 255 (full)

That would be terrific, alas, when I try that (remember, there is little to no documentation) bp barfs.

Here is the code and the error message:

`layout:
brightness: 10

shape: [32, 8]

driver:
c_order: BGR
gamma: [1.1, 0.5, 0]
ledtype: WS2812B
typename: serial
device_id: 0
brightness: 10

run:
fps: 10

animation:
typename: $bpa.matrix.Mainframe
`


`
pi@pi4:~/BiblioPixel/test1 $ bp test1.yml
ERROR - project_runner - 1 project failed


ERROR - project_runner - Unable to create drivers
Unknown attribute for driver Serial: “brightness”

Traceback (most recent call last):
File “/usr/local/bin/bp”, line 16, in
main.main()
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/main/main.py”, line 31, in main
module.run(args)
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/commands/run.py”, line 12, in run
project_runner.run(args)
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/project/project_runner.py”, line 27, in run
projects = _get_projects(args)
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/project/project_runner.py”, line 199, in _get_projects
raise ValueError(‘Run aborted’)
ValueError: Run aborted
pi@pi4:~/BiblioPixel/test1 $
`

I hope that makes sense

Belay that. That was a brainfart of mine. Apparently I still have something in the file that was not supposed to be there. I took the brightness statement out from the driver section and put it into layout and now it works.

Thanks for the help!

1 Like