Anders-Holst / xled_plus

Addons to the XLED package, to create nice effects for Twinkly LED lights
MIT License
33 stars 8 forks source link

How do you generally run this? #23

Open sihil opened 11 months ago

sihil commented 11 months ago

This is excellent! Last year I found https://github.com/scrool/xled but failed to find this project.

I'm wondering how you run this, especially in live mode? On a normal computer or on a SBC of some sort?

Thanks for working on this :)

Anders-Holst commented 11 months ago

It runs on any ordinary computer with python. The Readme text in this package shows how to get started and use it from a command line.

There are also examples of real-time effects (which I suppose is what you mean by live mode) in the samples directory. A simple one but still one of my favorites is the random walk in color space: python -m xled_plus.samples.colmeander (This effect is on purpose very slow, so give it a minute or two - you are not supposed to notice when it changes but every time you look up it has a new random color.)

If you want to experiment and develop your own effects, another way to run it is from a python shell:

>>> from xled_plus.samples.sample_setup import *
>>> ctr = setup_control()
>>> ctr.check_status()
<ApplicationResponse [1000]>

Now you have a HighControlInterface object connected to your leds in ctr which you can control and play with as you like. This is how I do it - I have a continuously open python shell with control objects for all devices I have, through which I turn them on or off ctr.turn_on() ctr.turn_off(), or change effect e.g ctr.show_effect(4) ctr.show_color((120,60,255)) Fire(ctr).launch_movie(). Through the control object you have access to the primitives defined both in xled (control.py) and xled_plus (highcontrol.py). Check out the code, including the examples in this repository on how to use it.

Anders