Hi guys, Ran across this library in search of something i can use on

Hi guys, Ran across this library in search of something i can use on an atmega at the same time using interupts for IR Remote access. Is there anyone who is using an IR remote and this library? I have used the neopixels library and once the LEDs are being displayed all IR remote activity is disabled due to the disableing of intreupts in the neopixels library. Will this library work?
Thanks in advance for your help!
Lots of cool things you guys are going here! Keep up the awesome work!
Ed

The problem is not with the library, the problem is with the combination of LEDs (neopixel/ws2812) and the MCU being used (air based arduinos).

The WS2812 timing requirements are pretty tight - so interrupts have to be disabled while writing out data for them. It turns out there is a small window between pixels where, in theory you could enable interrupts and allow the handlers to run, before disabling for writing the next pixel out. However, on the AVR based MCU’s, it is nearly impossible to write an interrupt handler that runs in this small of a window of time (even the SYSTICK timer doesn’t run quickly enough).

On some ARM based MCU’s (I think the teensy and the due - off the top of my head), the MCU is fast enough that you can have interrupts run between less, provided they run quickly enough (otherwise, the library will stop writing out the rest of the string of led data).

So - basically - you’re left with a couple of options:

  • switch to a teensy 3.x or due, where you can use interrupts
  • don’t use WS2812/neopixels where you want to do things that require interrupts that need to be handled while led data is being written. Use 4-wire led chipsets like APA102 or LPD8806, which don’t have the timing requirements
  • use a dual-MCU setup - with one MCU handling incoming IR data, and the other MCU writing led data, and have the led-writing MCU ask the IR MCU for data when it isn’t busy writing out led data.

(or to put another way, this library will work - as long as what you want is not the combination of WS2812/AVR/IR :slight_smile:

I have used two MCU’s, one for LED’s and second for the remote. With the FastLED library it will not work

It looks like there may be another option, if you’re using the IRRemote library.

You can call resume on the IRrecv object after calling FastLED.show - this seems like it might reset the IR receiver state enough cut back on reading corrupted IR data - worst case scenario, you might miss button presses, but it shouldn’t mis-receive. That might be something to play with though.

I am controlling WS2812Bs using IR. What I had to do was to use a mega 2560 for multiple strands of lights, and then use a uno to receive IR commands. I then translated them using a case statement and passed the information via wire to the mega. I configured the mega as master recieve and and duo as slave sender. There are probably much better solutions but after alot of trying that is what I came up with.