I have 60 WS2812B leds on a strip, connected to an arduino uno.
when I run a adafruit neonpixel test code, it works fine.
When I upload my own code, it stops at 31 leds. i need at least 36 for my project.
Is it a memory issue? i'm thinking about moving to another board for size-reasons (like esp32 eth01). will that solve it?
Thanks
when I compile the code, i get:
Sketch uses 12254 bytes (37%) of program storage space. Maximum is 32256 bytes.
Global variables use 1178 bytes (57%) of dynamic memory, leaving 870 bytes for local variables. Maximum is 2048 bytes.
#include "Ethernet.h"
#include "sACN.h"
#include "Adafruit_NeoPixel.h"
//Setup Ethernet
uint8_t mac[] = {0x90, 0xA2, 0xDA, 0x10, 0x14, 0x48};
IPAddress ip(169, 254, 89, 67);
IPAddress dns(169, 254, 89, 1);
IPAddress gateway(169, 254, 89, 1);
IPAddress subnet(255, 255, 0, 0);
//Setup sACN
EthernetUDP sacn;
Receiver recv(sacn);
const int Universe= 32;
const int NUM_CHAN= 36;
const int Channel[NUM_CHAN]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36};
int DMX[NUM_CHAN];
//Setup LED
const int DATA_PIN= 7;
const int NUM_LEDS=36;
Adafruit_NeoPixel Led(NUM_LEDS, DATA_PIN, NEO_GRB + NEO_KHZ800);
// Define colours
#define On 255,75,0
#define Off 0,65,255
#define Other 255,0,0
#define None 0,0,0
int Brightness=100;
void setup() {
Serial.begin(9600);
Ethernet.begin(mac, ip, dns, gateway, subnet);
recv.begin(Universe);
Led.begin();
Led.clear();
Led.show();
Led.setBrightness(Brightness);
}
void loop() {
recv.update();
for (int i=0; i<NUM_CHAN; i++){
// Read Channel input, Write to DMX value
DMX[i]= (recv.dmx(Channel[i]));
//Apply values to Leds
if (DMX[i]> 127){
Led.setPixelColor(i, Led.Color(On));
} else {
Led.setPixelColor(i, Led.Color(Off));
}
Led.show();
}
}