These are chat archives for Makuna/NeoPixelBus

7th
Apr 2016
Michael Miller
@Makuna
Apr 07 2016 00:59
@apullin I just added Rotate and Shift routines with a sample. While I was doing that I found I could optimize the ClearTo using a similar technique.
Andrew
@apullin
Apr 07 2016 00:59
Neat ... now I'll never learn proper C++ without a case study!
Michael Miller
@Makuna
Apr 07 2016 01:14
You can examine the change set to see how I did it ;-)
Andrew
@apullin
Apr 07 2016 02:30
ruh roh, I am getting Exception(29) on doing animations.UpdateAnimations() ...
Michael Miller
@Makuna
Apr 07 2016 02:34
@apullin your code or a sample?
when you call UpdateAnimations() it is doing callbacks into your animation functions that you passed to StartAnimations(); often this is where the problem lies.
Andrew
@apullin
Apr 07 2016 02:50
This is fairly wonky code, so I can understand if it is hard to wade through: https://github.com/apullin/nodemcu_RC_lights_anim
fails on restarting the animation, http://pastebin.com/jK3rzRLx ... oh what I wouldn't give for a proper debugger
Michael Miller
@Makuna
Apr 07 2016 03:17
@apullin (just observation) the wheel function could be removed, see https://github.com/Makuna/NeoPixelBus/wiki/FAQ-%236
Andrew
@apullin
Apr 07 2016 03:18
oh, yeah, it looks like you've really built out the colorspace tools ... that is just legacy for now
The reset is definitely happening becasue of the RotateRight function :\
Michael Miller
@Makuna
Apr 07 2016 03:18
Also, try loading this sample (NeoPixelRotateLoop) and try it. It does almost what you are doing for the animation.
see if it also causes a reset
Andrew
@apullin
Apr 07 2016 03:19
causes wdt reset
about every 9s
Michael Miller
@Makuna
Apr 07 2016 03:20
try changing it to rotate left rather than right.
Andrew
@apullin
Apr 07 2016 03:25
weird, that seems to not crash
Michael Miller
@Makuna
Apr 07 2016 03:26
@apullin in your code where you set lightsOn to false you should stop animations and not just skip the animations.UpdateAnimations() and restart it when you set it to true. Generally, there is little need to branch away from calling animations.UpdateAnimations(), you should just always call it and then call strip.Show(), both are smart and will return quickly if there is no work to be done.
lets me run some tests on it, I had a strange GIT issue when I was checking in and maybe it got borked.
Since you can repro with the sample, that means its my issue.
Andrew
@apullin
Apr 07 2016 03:29
hrm, I thought about moving this project to a Particle, but their neopixels library is just the simple old adafruit one, nothing like where you've taken this ...
Michael Miller
@Makuna
Apr 07 2016 03:31
I see a line where you check the time, every 30 seconds you call to update time; you might want to look into my Task library, it was meant to separate code out by tasks and set timer like that. Might be overkill, but this is what it was meant for. Its non-preemptive; so no worrying about threading issues.
I will get back with you on the crash in a few hours, sorry about that.
Andrew
@apullin
Apr 07 2016 03:45
nah no need for sorry, it is working in one direction at least, and I got my code updated to use Animations now. Is there a specific version of the ESP BSP or of the arduino IDE that needs to be used?
Andrew
@apullin
Apr 07 2016 03:50
good, good, it's working again: https://www.youtube.com/watch?v=KK7TQngz8Ak
Michael Miller
@Makuna
Apr 07 2016 20:59
@apullin I just released a new version 2.0.91 that includes the fix for rotate right. I also included a ClearTo() that takes a range.