//this code was working when i tested on a single stripe before the project
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
#define PIN 3 // On Trinket or Gemma, suggest changing this to 1
#define NUMPIXELS 3364 // Popular NeoPixel ring size
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 0 // Time (in milliseconds) to pause between pixels
void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
for(int i=0; i<NUMPIXELS; i++) { // For each pixel...
pixels.setPixelColor(i, pixels.Color(0, 50, 0));
pixels.show(); // Send the updated pixel colors to the hardware
delay(30);
}
}
So test it with half the screen first, or just reduce the number of LEDs in the code. Once that works, you will need to get yourself a board with more memory, though probably that will mean a 3.3v board of some kind.
Also keep in mind that with that many LED's your refresh rate is going to be only about 10Hz i think.
The calculus :
It depends a bit on what other peripherals you intend to connect, but i would suggest an ESP of some kind or a Teensy.
The refresh rate depends on the length of the chain, and so more or less fixed as 'Prince' is saying, but if you are able to modify an existing library to send multiple signals in parallel (eg write to the whole port rather than just to a pin) , then you could theoretically increase it 8x.
FastLED apparently has that feature built in for some boards, but i have never used it.
thanks for your answer, if i use this sort of code (on this image they split into 3 different pins) i can theorically increase it more than 8x ? if i use for instance 14 pins
You will still declare a buffer to big for the Mega
You will not be updating the leds 'parallel' so it will do nothing for framerate.
Go for what @david_2018 is suggesting in reply#15.
Use the Teensy 3.x and higher and for simplicities sake i would just order the shield as well.
All you will need is anyway to reduce the update time 5 times for smooth visual experience and that you will manage with ease. The DMA updating happens in the background so there should be enough processing time.
Look at the CPU-clock on a Teensy 4 that is more than 35 times as fast as the Mega.
i've bought a teensy 3.2 with the octoWS2811 adaptor and CAT6 cables for the data on leds stripes, I just don't understand which teensy pins are still free to use (to add other captors in my project)
is it only pins 0,1,23,22..17 ? the others are used by the adaptor ?