Hello everyone!
Timing problem here:
I’m running FastLED 3001000 along side with AccelStepper in the main loop of my program on a Teensy 3.2 @ 97 MHz in Arduino 1.6.7.
Ever since I included the FastLED.show & FastLED.delay functions, my motors are slowed down.
Any suggestions for alternative timing/delay/led signal generation routines that can help work around this collision? I assume it’s an interrupt-related issue, but I couldn’t find any clear indication of interrupts shared between the libraries.
I can only assume this must be an issue that’s been seen before, considering the popularity of both libraries, but I couldn’t track down any real solutions, so I decided to ask at the source.
Any ideas?
Best,
Stef
You can avoid the delay functions by using the every n milliseconds function instead. That’ll help but won’t solve the FastLED show issues.
How many LEDs are you using and what type are they?
What led chipset are you using? Also have you done ‘define FASTLED_ALLOW_INTERRUPTS 0’ - stepper libraries make heavy use of interrupts and FastLED has to disable them for writing out led data. There’s code in place to enable the interrupts between each led but the above define disabled that. Also you’re running a fairly old version of the library at this point, you should grab the latest from github
@Jeremy_Spencer using http://FastLED.delay lets one drive the dithering engine.
Wow, thanks a lot, that’s exactly what I was looking for. I never suspected the FastLED.delay function to be blocking anyway, and I do use the dithering quite heavily because I need to keep the Neopixels very dim for my application, so I’ll try the Interrupt code and check back!
*I’m gonna try the GitHub first, and then the interrupt code 
Unfortunately, neither the newer version nor the
#define FASTLED_ALLOW_INTERRUPTS 0 statement worked out for my configuration.
I use a fairly high microstepping rate for my stepper drivers because I need smooth motion, so the step signal can reach 10kHz. I’m not sure if I can really indulge in running animations while the motors are activated, which is sadly when the thing is doing it’s thing.
yugh…I’m stuck with the 16 Neopixel ring that has multiple assemblies designed around it and no APA102 alternatives in the same form factor. Anything you guys know of?
Sorry - I should’ve been clearer - you don’t want to disable interrupts - stepper motors need the interrupts to fire regularly to drive them.
I wonder if you can use the OctoWS2811 driver? I don’t know if OctoWS2811’s use of DMA and timers interferes with stepper motor usage or not.
At the small added cost… MHO. add a arduino mini at the display driver and trigger pattern timming from the Teensy… alternate patterns can then be done without impacting the stepper motors speeds…
I’ve got some 80mm 33 led APA102 rings, but I suspect that they’re bigger than the ones you’re using.
I agree with @John_Sullivan , use two (or more) controllers. I often do this with the D1 mini and a teensy. The easytransfer library works really well and lives up to its name