Re: Neopixel Compatibility with i2C Receive Event?

I am using I2C (wire.h) and adafruit_neopixels. As soon as my slave device receives data, the neopixels stop working. I have also tried using the FastLED library with the same result. I think the issue involves the interrupts but I'm not sure.

I never used to have issues until I updated the IDE which in turn updated the libraries. Unfortunately, I don't know which version was the functioning version. I am only having the issues now but the last time I worked with these sketches was over a year ago.

Has anyone else seen the issue or a fix for it?

Thank you

I too am having a major issue with the I2C bus interfering with the neopixels but I don't have the option to switch master / slave (I have 1 master and 3 slaves).

Has anyone found a solution?

So far, I have used i2c with a few NeoPixel projects that I use regularly. From what I can tell, the master/slave swap I mentioned several months ago wasn't to fix an i2c/neopixel compatibility, but rather my overall Arduino incompetence at the time.

I do not believe I2C and Neopixels have any compatibility issues.

However, misusing I2C events can certainly cause compatibility issues! One thing I learned about I2C is that you need to avoid doing anything extensive in the handlers. Don't launch a new Neopixel animation, don't do any delays. Set a variable and get out.

For a more complex Arduino I2C & Pixel project, I'm receiving I2C commands at the Arduino, and I have converted my NeoPixel code to be asynchronous (or rather, "asynchronous"). See the Adafruit guide.

But, my guess is that you're trying to do too much in your I2C handler on the Arduino.

Yeah - as long as the master's timeout isn't so aggressive that it times out if the first byte is sent while the slave is updating the pixels, it should work...

You should definitely never write to neopixels from within an ISR though - that's one of those timeconsuming things that you really don't want to try doing from within an ISR.

This topic has been merged into Re: Neopixel Compatibility with i2C Receive Event?.

@Big D, do not hijack. Threads split.

@Big D, do not cross-post. Original post mutilated.