Hello,
I'm using a Feather RP2040 Scorpio to drive NeoPixels with the NeoPXL8HDR library but I have a problem.
I followed the NeoPXL8HDR strandtest example and made another sketch to isolate my problem :
#include <Adafruit_NeoPixel.h>
#include <Adafruit_NeoPXL8.h>
// NeoPXL8HDR config
#define NUM_LEDS_PER_STRIP 60
#define NUM_STRIPS 8
// Using RP2040 SCORPIO :
int8_t pins [8] = { 16, 17, 18, 19, 20, 21, 22, 23 };
Adafruit_NeoPXL8HDR leds(NUM_LEDS_PER_STRIP, pins, NEO_GRBW); //using RGBW LEDs
void setup() {
Serial.begin(115200);
while (!Serial){}; //Waiting for Serial
// Initialize NeoPXL8HDR
leds.begin(true,4,true);
leds.setBrightness(20); //No gamma correction for simplicity
leds.clear();
leds.show();
Serial.println("setup");
}
void loop1() {
leds.refresh(); //Same principle as strandtest example
}
void loop() {
Serial.println("loop0");
//Filling strips with red
for (int i = 0; i < NUM_LEDS_PER_STRIP*NUM_STRIPS; i++) {
leds.setPixelColor(i, 255,0,0,0);
}
leds.show();
delay(1000);
// Turning off strips
leds.clear();
leds.show();
delay(1000);
}
The code runs perfectly because I see my strips blinking red but after 2 or 3 loops, I don't see any "loop0" in the serial monitor of my computer.
If I comment "leds.refresh();", the "loop0" is sent to my computer with no problem. Same result if I add a 10ms delay after the refresh but that defeats the whole purpose of the refresh looping alone on loop1.
Can someone help me understand why me Serial.print gets lost after a while ? How could I make sure my Serial.print get sent ? I tried stopping the loop1 before my Serial.print and resuming it after with code below but it changes nothing.
rp2040.idleOtherCore();
Serial.println("loop0");
rp2040.resumeOtherCore();
Thanks in advance.