I have a WS2812B LED strip and a speaker( http://www.seeedstudio.com/depot/Grove-Speaker-p-1445.html ).

I have a WS2812B LED strip and a speaker(http://www.seeedstudio.com/depot/Grove-Speaker-p-1445.html).

I used Tone() for my speaker. With different input frequency, the speaker generated different tones.

The speaker produced the correct tones, without the LED strip.
When connected with LED strip, the sound became distorted.

It is possible for both them to work simultaneously?

Are you able to share your code on pastebin or gist?

From the arduino Tone page:
“Use of the tone() function will interfere with PWM output on pins 3 and 11 (on boards other than the Mega).”

Also, what micro controller are you using?

Hi! The short version is that I think you can’t use WS2812B and “Tone” at the same time – the WS2812B’s have very demanding communication timing requirements that can only be satisfied by disabling interrupts.

SO, yes: FastLED disables interrupts if you use LEDs that require it – like the WS2812B.

“Three-wire” LED strips like WS2811 / “Neopixels” DO require that interrupts are disabled, for communication timing reasons.

“Four-wire” LED strips like APA102 and LPD8806 do NOT require that interrupts be disabled.

So, yes, FastLED will sometimes disable interrupts while performing the “FastLED.show()” – if you are using “three-wire” LED strips like WS2811/Neopixel strips. As soon as the call to “FastLED.show()” returns, interrupts are re-enabled.

Have you considered ‘upgrading’ to APA102 LEDs? Is that an option for this project?

Thanks for your reply.

Does APA102 requires additional codes? I’m looking at example(FirstLight ) but I cannot find APA102 under addLeds. Which one does it belongs to?

APA102 is fully supported. Even if the example hasn’t been updated, the library supports it well.

I do recommend that you make sure you use the FastLED 3.1 branch from github to get all the latest patches.

Ok. Thank you! Marc & Mark

hmmm I’m having some trouble purchasing APA102. I couldnt find any shops that sells this in my country(Singapore). They only sells ws2812.