Commit graph

198 commits

Author SHA1 Message Date
73d5f61c6e
Optimize comet draw
The big pay-off is avoiding enumerate(). Removing redundant
comparisons of _ring() and avoiding modulo operations help too.
2022-11-10 16:51:02 -06:00
914bb8060b
speed bar generation by not querying pixels
In a test this improved speed substantially, nearly doubling
the speed of the following test program
```python
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=1, auto_write=False, pixel_order="RGB")
evens = helper.PixelMap(pixels, [(i,) for i in range(0, pixel_num, 2)], individual_pixels=True)
animation = RainbowChase(evens, 0, spacing=8)
t0 = adafruit_ticks.ticks_ms()
while True:
    for i in range(10):
        animation.animate(show=False)
    t1 = adafruit_ticks.ticks_ms()
    print(f"{10000/(t1-t0):.0f}fps")
    t0 = t1
```

Performance on Raspberry Pi Pico W:
Before: ~85fps
After: ~140fps

This also happens to make it compatible with an in-process PR that adds
a fast PixelMap-like class to the core, but which doesn't support
getitem.
2022-11-10 16:48:35 -06:00
Alec Delaney
24319aac5d
Fix pylint errors 2022-11-07 20:34:04 -05:00
Alec Delaney
c19e802c65 Fix release CI files 2022-11-04 09:12:45 -04:00
arturo182
829cd1d7af
sequence: Add a function to play the previous animation 2022-08-22 15:35:27 +02:00
Dan Halbert
364226f3c5
Merge pull request #100 from vm0824/fix-short-circuit-group-animate
broke out animate() logic to guarantee each item calls animate
2022-08-17 10:57:40 -04:00
Alec Delaney
4326d9e9dd Update version string 2022-08-16 18:09:15 -04:00
Vin Minichino
d9b877d8ba blacked 2022-08-09 15:33:56 -04:00
Vin Minichino
d02dde7622 cleanup comments 2022-08-09 13:38:12 -04:00
Vin Minichino
ba57e7a6e1 broke out animate() logic to guarantee each item calls animate without short circuit 2022-08-09 13:04:58 -04:00
Alec Delaney
444c0841d7 "Reformatted per new black version" 2022-03-29 18:15:55 -04:00
dherrada
9fde73f3dc Pylint and RTD update patch, and other fixes 2021-11-11 15:33:12 -05:00
Kattni Rembor
f2e57d9c71 Fix code block, force Sphinx update on RTD. 2021-11-03 13:34:01 -04:00
Kattni
8d378fa2ed
Merge pull request #84 from rhooper/sparkle-mask
Move sparkle mask example to own file to make mergeable
2021-10-31 15:55:05 -04:00
Kattni
76d419afc6
Merge pull request #78 from plugowski/master
Fixed reverse mode for Comet / RainbowComet animation.
2021-10-31 15:52:26 -04:00
Rose Hooper
4d6c98ff0d Merge branch 'main' into sparkle-mask 2021-10-31 15:14:06 -04:00
Kattni Rembor
1f17980222 Sphinx. 2021-09-23 17:50:42 -04:00
Kattni Rembor
30226d4983 Updating to use rainbowio. 2021-09-23 17:44:52 -04:00
Paweł Ługowski
a18eb1134c pre-commit code reformat 2021-05-18 12:01:57 +07:00
Paweł Ługowski
da7484427c Fixed reverse mode for Comet / RainbowComet animation. 2021-05-03 10:49:41 +07:00
Dylan Herrada
312c0428e0
Moved to generator 2021-04-19 17:09:50 -04:00
dherrada
4ada0c2017 Ran pre-commit, added licenses 2021-01-12 10:37:24 -05:00
Kattni Rembor
1fbf719844 Fix color documentation. 2020-12-08 15:32:46 -05:00
Kattni Rembor
226eb6fe86 Adding old lace color for cheerlights project. 2020-12-01 16:12:02 -05:00
Karan Bhatia
0fea0a48f1 added black recommended change 2020-11-25 00:29:59 -05:00
karan bhatia
b5e93fd414 updated code based on pylint and PR feedback. 2020-11-24 13:29:37 -05:00
karan bhatia
c3b868b880 fixed formating issue identified by black and pylint 2020-11-23 14:35:05 -05:00
karan bhatia
5f56db76aa fixed a few issues, added heart example for sparkle animation 2020-11-22 09:47:23 -05:00
karan bhatia
f4a25f5a4f added mask array for sparkle animation 2020-11-20 14:44:07 -05:00
Roy Hooper
d9fe17e91a remove self from copyright, authors 2020-08-16 20:34:18 -04:00
Roy Hooper
7d94b3e48f fix for 6.x - montonic_ns returns NotImplementedError 2020-08-12 12:25:40 -04:00
Roy Hooper
78020595b0 fix references to _ns 2020-08-12 12:21:51 -04:00
Roy Hooper
5606528a37 add docstring 2020-08-12 11:22:51 -04:00
Roy Hooper
ea7d2e1cdc use milliseconds instead to support smaller boards 2020-08-12 11:19:18 -04:00
rhooper
c18151fb17
Merge pull request #61 from georgebohnisch/master
Add colors for RGBW strips to target the RGB or RGBW LEDs
2020-07-13 13:02:54 -04:00
George Böhnisch
30af259e0c Add colors for RGBW strips to target the RGB, W, or RGBW diodes 2020-07-13 11:58:44 -05:00
Kattni
5d99d5ff2c
Merge pull request #60 from rhooper/ring_support
add ring support - #42
2020-07-10 18:13:59 -04:00
Roy Hooper
65376c68e4 blackness 2020-07-10 17:45:26 -04:00
Roy Hooper
2af26b7a66 add ring support - #42 2020-07-10 17:42:21 -04:00
rhooper
19df7c95f3
Merge pull request #58 from cjsieh/cycle_complete
cycle_complete not triggered for Chase animation
2020-06-27 15:24:02 -04:00
rhooper
48ff1e8a36
Merge pull request #49 from nnja/fix_sparkle_and_sparklepulse_animations
Fix off by 1 error affecting Sparkle and SparkePulse animations
2020-06-26 18:12:46 -04:00
cjsieh
1ce87805cc
Add files via upload
fix for issue #56  --  cycle_complete not triggering for Chase animation
2020-06-26 10:35:47 -05:00
Roy Hooper
cda21457fe fix sync when there are multiple different pixel objects involved 2020-06-22 20:59:31 -04:00
Kattni
22b9ec8516
Merge pull request #55 from rhooper/fill-fix
make animation.fill() show the pixels
2020-06-22 19:20:58 -04:00
Roy Hooper
09e5f656ce make animation fill show the pixels. 2020-06-22 19:13:26 -04:00
Roy Hooper
beaa41f0cb fix sparklepulse to use _set_color 2020-06-22 18:15:08 -04:00
Roy Hooper
7b5ba8222e fix color setting so that animations like blink aren't reset on color setting 2020-06-22 17:50:16 -04:00
Nina Zakharenko
da0d851323 Fix off by 1 error affecting sparkles 2020-06-20 14:47:21 -07:00
cjsieh
ef4435c4bf
Delete customcolorschase.py
changed from customcolorschase to customcolorchase
2020-06-19 21:26:18 -05:00
cjsieh
201bb4781a
Add files via upload
Changed references to rainbowchase.  Changed from CustomColorsChase to CustomColorChase
2020-06-19 21:24:34 -05:00