Mystery solved!
TL;DR version: It was an old Neopixel library version.
War And Peace version:
Your example, adjusted for an external 'strip' of one (and my c coding style, of course) ;-) first behaved like my previous versions, as in one and only one would light.
After playing around for a few minutes, trying to figure out exactly which statement caused things to break, just for giggles, I tried compiling and loading it on the Windows peecee in the home office, as opposed to the Linux machine I usually use. This time it worked as expected! Both the internal and external Neopixels worked.
I then started looking at differences, and it was the library version. Doing a quick update of the Neopixel library fixed it.
This makes sense, since when I did a quick check-out of the code, it appeared that the 2040 section was kind of duct-taped in as an add-on to the legacy Feather code sections.
I'm sure that they had reports (internally or externally) of two Neopixel instances failing, so they fixed it.
Now the strangest one, which does verify what I call a 'resource fight' is this one.
Code: Select all
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel pixels(1, 12, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel internal_pixel(1, 16, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels
void setup()
{
pinMode(13, OUTPUT);
pixels.begin();
internal_pixel.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop()
{
digitalWrite(13, LOW);
pixels.clear();
pixels.show();
internal_pixel.clear(); // Set all pixel colors to 'off'
internal_pixel.show();
delay(DELAYVAL);
internal_pixel.setPixelColor(0, internal_pixel.Color(0, 15, 0));
digitalWrite(13, HIGH);
internal_pixel.show(); // Send the updated pixel colors to the hardware.
delay(DELAYVAL); // Pause before next pass through loop
}
This was when I was futzing around trying to figure out exactly things were breaking, removing and inserting various statements.
Note that the color is NOT set on the external Neopixel, nor is show() called on the external after setting the color, but when this code above was run on the old library, it was the EXTERNAL Neopixel that flashed.
Anyway, thanks for the assistance and I'm glad that they corrected the issue.
And, if anyone wants to see an example of some very spooky inline assembler code, check out the Neopixel library! I'm glad I did not have to write (or maintain) that one! ;-)