Hey folks. Thanks for all the work on this project. Can someone please give me some advice? I downloaded the RFduino 3.1 library to use with Arduino IDE 1.6.3 (on a macbook) with RFduino and 100 WS2811 400 KHZ leds. However, I have tried 3 example programs and no matter what I do, I light up only the first 45 LED’s. Then nothing. If I set the num_led variable to less than 45 it works fine, but if it is set it to anything greater than 45, only the first 45 light up. I am happy to post the example code and a video of the LED’s, but given that three programs act the same way I am suspecting the library.
PS. This whole string works fine using the Adafruit library, so I don’t believe I have a hardware issue.
Thanks for any suggestions or help!
It is likely that there’s some interrupt handler running that is taking too long - and what you’re seeing happening is FastLED detecting that an interrupt has run too long and is cutting off writing out further LED data so that it doesn’t get corrupted. I suspect this is less of an issue with 800khz WS2811 leds.
Are you using the FastLED3.1 branch or the rfduino branch? (be sure to be using the FastLED3.1 branch).
Unfortunately, completely disabling interrupts on the rfduino when also using bluetooth will cause some pretty severe problems (so it’s not even a thing that can be turned off for FastLED) because the nordic bluetooth subsystem freaks out if interrupts are disabled for too long. I just added support for fully disabling interrupts on the rfduino. Get the latest FastLED3.1 branch and then add the following line before your #include<FastLED.h>:
#define FASTLED_ALLOW_INTERRUPTS 1
Daniel,
Im sorry to tell you this made no difference whatsoever. BTW - I am using the 2812B LED.s. It is interesting that I need to tell the Adafruit NEOpixel library that they are 2811’s to get them to work , but they work. I have tried 2811, 2811_400, 2812, 2812B, and NEOpixel with the FASTLED library and the best result is that I can get to the 45th LED and then nothing. Any other suggestions? Again, thanks for all of your work on this project!!!
Sorry - that should be a 0, not a 1:
#define FASTLED_ALLOW_INTERRUPTS 0
(And remember to grab the latest 3.1 branch - I only just put this in there the other day)
We did grab the new 3.1 branch and we tried both 0 and 1. The behaviors are the same.
Jim
I’ll check the interrupt disabling code again (my rfduino is packed away, not terribly easy to test with at the moment)- but what you are describing is definitely an interrupt cutting off the data being written out. (Also make sure that you don’t have multiple copies of the library - and that you are using the 3.1 branch, not the rfduino branch)
Also, just checking because I haven’t seen any of your code - but you did put that line before the #include, right?
Ah!! That was it. Sorry. Didnt see the “before” in your last post. Changing the parameter to 0, and putting the additional line before the include make the examples work great!!!