These are chat archives for Makuna/NeoPixelBus

May 2017
May 10 2017 19:14
Hi all, after switching from adafruit neopixel library to neopixelbus I've decided to convert most of the functions of my sketch using the powerful animator object. So far so good, I've converted all, and now the sketch is a lot cleaner and shorter, and more efficient. But there is a function (not related to neopixelbus) that apparently prevents the animator to work correctly. After reducing the complexity of this function step by step I ended up with a minimum code, that apparently is not doing anything, but without that, the entire sketch doesn't work anymore. The function is just setting a variable from LOW to HIGH, but this variable is never used anywhere. The function is something like this, and is called in loop:
Void powerDraw(){
If (millis() - previousmillis < 1) {
Randomvar = HIGH
So, the condition is never true, because previousmillis is set to 0
But if I don't call this function, the sketch doesn't work, most of the times it triggers a wdt reset, sometimes simply doesn't do nothing
May 10 2017 19:20
If I print that variable in the loop, it always stays LOW, confirming that the code is never used by the sketch, but still, is essential to make the sketch work. Not a big problem, just curiosity, I've tried for hours to understand what's happening, but no idea at all
May 10 2017 19:31
Forgot to mention that I'm using the esp8266 with Dma mode, with WiFi, and Osc messages
May 10 2017 20:30
ok, found the problem by myself, it was as simple as a for cycle with a <= instead of a <
so i was basically trying to call a non existent animation channel
still i cannot understand why with that function it was working, when it shouldn't
Michael Miller
May 10 2017 22:51
Since I don't know where Randomvar or even previousmillis was defined or used elsewhere its hard to say. Not sure even where powerDraw() was being called from without having the sketch ;-)