FastLED-driven strip acts weird when using PN532 A LED-strip (WS2812B, 46 pieces, PIN 8) and an Adafruit PN532 RFID shield (IRQ 2) are attached to my Arduino Mega 2560.
The GRB based strip seems to be working fine with FastLED in the beginning, I can confirm this by cycling through all three base colours in setup().
Once I call nfc.readPassiveTargetID(...) and use an NFC tag on it, things start to get weird. Whenever I comment out the line, it works properly again.
The colors RGB are randomly swapped (as if I had passed a different color ordering), brightnesses may change randomly as well, and sometimes a few LEDs in the beginning or end of the strip have different brightness/color as the rest.
As I have put the brightness down to 32, I'm sure it's not a power problem.
My assumption is that there is either some memory corruption, or some PIN interference with the two libraries, although I don't know why it would do it. Please find my code below, any help is appreciated.
  #include &lt;FastLED.h&gt;
  #include &lt;Adafruit_PN532.h&gt;
  
  #define LED_COUNT 46
  #define LED_DATA_PIN 8
  CRGB leds[LED_COUNT];
  
  #define PN532_IRQ (2)
  #define PN532_RESET (3) // Not connected
  
  Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);
  
  void setLeds(CRGB color) {
    Serial.print(&quot;setLeds(&quot;); Serial.print(color.r, DEC ); Serial.print(&quot;,&quot;); Serial.print(color.g, DEC ); Serial.print(&quot;,&quot;); Serial.print(color.b, DEC ); Serial.println(&quot;)&quot;);
    for (int i = 0; i &lt; LED_COUNT; i++) {
      leds[i] = color;
    }
    FastLED.show();
  }
  
  void ledStartSequence() {
    setLeds(CRGB::Black);
    for (int crtLed = 0; crtLed &lt; 23; crtLed++) {
      leds[crtLed] = CRGB::Blue;
      leds[crtLed + 23] = CRGB::Blue;
      FastLED.show();
      delay(20);
    }
    Serial.println(&quot;Red&quot;);
    setLeds(CRGB::Red);
    delay(1000);
    Serial.println(&quot;Green&quot;);
    setLeds(CRGB::Green);
    delay(1000);
    Serial.println(&quot;Blue&quot;);
    setLeds(CRGB::Blue);
    delay(1000);
  
    Serial.println(&quot;Off&quot;);
    setLeds(CRGB::Black);
  }
  
  void initLeds() {
    FastLED.addLeds&lt;WS2812B, LED_DATA_PIN, GRB&gt;(leds, LED_COUNT);
    FastLED.setBrightness(32);
  }
  
  void initSerial() {
    Serial.begin(9600);
    Serial.println(&quot;Hello!&quot;);
  }
  
  void initNFC() {
    nfc.begin();
    uint32_t versiondata = nfc.getFirmwareVersion();
    Serial.print(versiondata);
    if (! versiondata) {
      Serial.print(&quot;Error: Didn't find PN53x board&quot;);
      while (1); // halt
    }
    // Got ok data, print it out!
    Serial.print(&quot;Found chip PN5&quot;); Serial.println((versiondata &gt;&gt; 24) &amp; 0xFF, HEX);
    Serial.print(&quot;Firmware ver. &quot;); Serial.print((versiondata &gt;&gt; 16) &amp; 0xFF, DEC);
    Serial.print('.'); Serial.println((versiondata &gt;&gt; 8) &amp; 0xFF, DEC);
  
    nfc.SAMConfig();
  }
  
  void setup() {
    initSerial();
    initLeds();
    initNFC();
    ledStartSequence();
  }
  
  void loop(void) {
    Serial.println(&quot;Waiting for an ISO14443A Card ...&quot;);
    setLeds(CRGB::Red); // only displayed correctly in the first iteration
    uint8_t success;
    uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
    uint8_t uidLength;
  
    success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &amp;uid[0], &amp;uidLength);
    /*
     *  Here's where things start to go nuts!
    */
    delay(1000);
    setLeds(CRGB::Green); // usually not displayed correctly
    delay(1000);
    setLeds(CRGB::Blue); // usually not displayed correctly
    delay(1000);
  }
After spending way too much time on the code, I figured that it had to do with something entirely different:
The RFID reader created an RF interference on the data wire towards the LED strip... Shielding it properly did the trick, no matter which pin is being used.
Thanks for the help anyway.