sorry, I'm just learning, if I write stupid things, please correct me.
I undertook a LED project on ESP32 with WS2812B LED. I bought 5m and divided the strips into two parts. I connected the power supply, back to ESP32, but I get an error when I want to connect more than 75 LEDs
#include <Adafruit_NeoPixel.h>
#define PinLEDY 33
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(80, PinLEDY, NEO_GRB + NEO_KHZ800);
int NUMPIXELS=100; // ilosc ledow
int count=0;
int redColor = 250;
int greenColor = 0;
int blueColor = 0;
int CzyWlaczony=0;
int j=0;
void setup() {
pixels.begin();
Serial.begin(9600);
delay(1000);
}
void loop() {
int i=0;
for(i=0;i<NUMPIXELS;i++)
{
pixels.setPixelColor(1, pixels.Color(255, 255, 255));
delay(10);
pixels.show();
delay(100);
}
delay(100000);
}
void allBlack()
{
for (uint16_t indexPixel = 0; indexPixel < NUMPIXELS; indexPixel++)
{
pixels.setPixelColor(indexPixel, 0x000000);
}
pixels.show();
delay(100);
delay(1000);
}
Error
Guru Meditation Error: Core 1 panic'ed (Double exception).
you're right, but I've tried to write so many things in so many ways that the "dealay" was left from the old code, plus addressing only one LED. I wanted to show the simplest example/
This isn't doing anything useful. your pixel code should be inside this. Then again, you are inside a for loop when you should be in a while loop, manually advancing the index.
I should also point out this is only setting the pixels to be white forever but I sure there is more code to be added later to change that.
That's not clear to me.
You code runs fine (even the buggy code that accessed beyond the end of the NeoPixel array) on an ESP32 Dev Board. There were no actual NeoPixels connected, but that's irrelevant. I did change to Pin 4 for the LEDs.
Even bumped the number of Pixels up to 200.
Using Arduino IDE v1.8.19. ESP32 Core 3.0.4, NeoPixel Library v1.11.0.
#include <Adafruit_NeoPixel.h>
#define PinLEDY 4
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(200, PinLEDY, NEO_GRB + NEO_KHZ800);
int NUMPIXELS = 200; // ilosc ledow
int count = 0;
int redColor = 250;
int greenColor = 0;
int blueColor = 0;
int CzyWlaczony = 0;
int j = 0;
void setup() {
pixels.begin();
Serial.begin(115200);
delay(1000);
}
void loop() {
int i = 0;
for (i = 0; i < NUMPIXELS; i++) {
pixels.setPixelColor(1, pixels.Color(255, 255, 255));
delay(10);
pixels.show();
delay(100);
Serial.println(i);
}
delay(100000);
}
void allBlack() {
for (uint16_t indexPixel = 0; indexPixel < NUMPIXELS; indexPixel++) {
pixels.setPixelColor(indexPixel, 0x000000);
}
pixels.show();
delay(100);
delay(1000);
}
I downloaded NeoPixel Library v1.11.0 and it started working. Thank you very much guys for your help! I couldn't have done it without you and I still wasted 3 evenings...