For your info, I settled on an approach where some number of buttons and leds can be configured, and then treated logically. "Set LED1 cyan", etc. We use three-color LEDs and two color LEDs are common, so there is a simple way to specify them. In /etc/bn/gpio/config.txt:It beats having them hard coded. Then it is possible just to poke an octal value (rgb) into a file like this:I think that gives you magenta. In the background, code based on drankinatty's example follows instructions to make it happen. Buttons can follow a similar model, going the opposite direction. (E.G. monitor /etc/bn/gpio/btn1) I would expect that we would start it with systemd and let it run in background. Thusly isolated, things will seem simple.
My notion is that something like that might be accessible for beginners. IDK. The bash script in libgpiod seems pretty accessible too but we didn't wanna ship a production system based on that.
Code:
[led1]colors=3red=25green=8blue=7[led2]colors=3red=11green=9blue=10[led3]colors=1pwr=26
Code:
$ echo 5 > /etc/bn/gpio/led0
My notion is that something like that might be accessible for beginners. IDK. The bash script in libgpiod seems pretty accessible too but we didn't wanna ship a production system based on that.
Statistics: Posted by theleftover — Wed Sep 18, 2024 2:18 am