Page 2 of 2

Re: TrickLED - NeoPixel WS2812B Animation Library

Posted: Fri May 21, 2021 7:18 am
by sgar
Primesty wrote:
Sun May 16, 2021 9:40 pm
Hi Sgar,

Thanks, I’ll give that a shot.
Any luck with this? :)

Re: TrickLED - NeoPixel WS2812B Animation Library

Posted: Sun May 23, 2021 4:27 pm
by Primesty
Any luck with this?
Hi Sgar, YES that worked! I first downgraded to MP 1.14 and tried everything. I might have put all the files in the /lib sub_dir instead of giving trickLED its own sub-dir on the ESP32. Now the demo file runs without a hitch also on MP 1.15.

Thanks a lot:)

Re: TrickLED - NeoPixel WS2812B Animation Library

Posted: Mon May 24, 2021 3:39 pm
by sgar
Primesty wrote:
Sun May 23, 2021 4:27 pm
Any luck with this?
Hi Sgar, YES that worked! I first downgraded to MP 1.14 and tried everything. I might have put all the files in the /lib sub_dir instead of giving trickLED its own sub-dir on the ESP32. Now the demo file runs without a hitch also on MP 1.15.

Thanks a lot:)
Nice! If you achieve to change the brightness in animations please share! :lol:

Re: TrickLED - NeoPixel WS2812B Animation Library

Posted: Mon May 24, 2021 3:44 pm
by Primesty
Nice! If you achieve to change the brightness in animations please share! :lol:
Will do! :)

Re: TrickLED - NeoPixel WS2812B Animation Library

Posted: Fri Sep 17, 2021 8:35 pm
by Primesty
Hi @sgar,

You might have figured this out already, but there is a global brightness setting in the trickLED.py file, which you might be able to manipulate:

Code: Select all

global_setings = {
    'brightness': 200,
    'interval': 60,
    'palette': None,
    'animation': None
}
The various animation functions also all have brightness setting, which you might be able to manipulate.

Code: Select all

class AnimationBase:
    """ Animation base class. """

    def __init__(self, leds, interval=50, palette=None, generator=None, brightness=200, **kwargs):
        """
        :param leds: TrickLED object
        :param interval: millisecond pause between each frame
        :param palette: color palette
        :param generator: color generator
        :param brightness: set brightness 0-255
        :param kwargs: additional keywords will be saved to self.settings
        """

Since
MappedAnimationBase
seems to inherit from
AnimationBase
and Fire, in turn, inherits from
MappedAnimationBase
you might be able to feed the brightness parameter into it.

Maybe that helps

Re: TrickLED - NeoPixel WS2812B Animation Library

Posted: Mon Dec 27, 2021 8:52 pm
by markvanpraet
Not sure if it's appropriate to reply on this post, but I believe that MP 1.17 has introduced an issue. While working well at MP 1.15, when the demo is loaded and run under 1.17 it throws an error:

Demonstrating animations press CTRL+C to cancel... or wait about 2 minutes.
LitBits settings: default
Traceback (most recent call last):
File "<stdin>", line 181, in <module>
File "<stdin>", line 51, in demo_animations
File "<stdin>", line 39, in play
File "neopixel.py", line 1, in fill
TypeError: 'int' object isn't subscriptable

I am using Thonny on an ESP32 (NodeMCU).

There's just too much functionality to sacrifice in the rewrite of my principal code to remain at 1.15, so I'll have to live without animations and generators for now (sadly).

If there's any further info I can provide, please let me know.