adafruit / Adafruit_NeoPixel

Arduino library for controlling single-wire LED pixels (NeoPixel, WS2812, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arduino Nano RP2040 Connect sends signal for different led strips with same pin

HSVDO opened this issue · comments

  • Arduino board: Arduino Nano RP2040 Connect (with/without headers)

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.16

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):

When connecting more than 1 led strip to different digital pins the signal strength is added together and sent as output to the first specified pin. The second pin does not output any signal. When I change the order of the specified pins, the summed signal goes to the second (now configured as first) pin. This gives weird colors as result (see 'current behavior.png'). I tested the code with an Arduino Nano Every and it works fine with that kind of board (see 'expected behavior.png'). I can reproduce this problem with 3 different Arduino Nano RP2040 Connect boards following these steps:

multipleLedStripsExample.zip

  1. Connect two neopixel strips to power supply
  2. Upload sketch to board
  3. Connect the two led strips to the specified pins (e.g. D6 & D7)
  4. Connect board to power supply
  5. Apply power

OR

  1. Upload sketch to board
  2. Measure voltage output on specified pins (e.g. D6 & D7)

Current behavior:
current behavior

Expected behavior:
expected behavior

I have created a pull request #307 for a change to the library that permits up to 8 library instances to be used. So up to 8 independant pixel strands can be controlled, each strand on it's own pin.

Issue resolved with PR #307. Thank you!

@Bodmer thanks for working on this!
Since I couldn't test it before, I tested the new version 1.10.2, but now I run into another error when compiling:

ResolveLibrary(Adafruit_NeoPixel.h) -> candidates: [Adafruit_NeoPixel@1.10.2]

Arduino\libraries\Adafruit_NeoPixel/Adafruit_NeoPixel.h:397:3: error: 'PIO' does not name a type; did you mean 'EIO'? PIO pio = pio0; ^~~ EIO

Using board:
BN: Arduino Nano RP2040 Connect VID: 2341 PID: 005e

OK, it works fine with Earl Philhower's RP2040 board package but I see that the Arduino package throws the error.

I have created a pull request #308 that fixes this.

The fix is that the RP2040 #include files need to be in the header file.

It now works fine with the Arduino Nano RP2040 Connect, too. Thanks! :)