Das habe ich nun probiert:
fügt man den Code im Loop hinzu, so funktioniert dies weiterhin nur bis zu 157 LEDs. Klar - denn vorerst muss der LedStripe initialisiert werden und dort darf keine höhere Zahl eingegeben werden. Im Code unten wird die Länge des Stripes festgelegt.
Adafruit_NeoPixel pixels(numLeds, PIN, NEO_GRB + NEO_KHZ800);
jedoch treten durch die Eingabe im Loop eigenartige Fehler auf -> auch nicht angesprochene LEDS im Bereich (150-156) leuchten in zufälligen Farben.
Ich habe nun das Programm von Null weg aufgebaut um die Zeile zu finden wo der Fehler liegt.Bis ich draufgekommen bin, dass der Fehler in der Artnet library liegen dürfte. Denn bei folgendem Code funktionieren alle Leds (Librarys sind alle im Programm und die LEDs werden erfolgreich angesteuert):
#include <Artnet.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
#include <Adafruit_NeoPixel.h>
const byte PIN = 2 ;
const short numLeds = 300; // Popular NeoPixel ring size
const byte channelsPerLed = 3;
const short numberOfChannels = numLeds * channelsPerLed;
Adafruit_NeoPixel pixels(numLeds, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
pixels.setPixelColor(150, pixels.Color(0, 150, 0));
pixels.show();
delay(300);
pixels.setPixelColor(150,pixels.Color(0,0,150));
pixels.show();
delay(300);
}
Also gehe ich einen Schritt weiter und füge zum Code "Artnet artnet;" hinzu
Dann tritt das Phänomen wieder auf -> jedoch werden die LEDs bis zu einer Zahl von einschließlich 211 angesteuert.
#include <Artnet.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
#include <Adafruit_NeoPixel.h>
const byte PIN = 2 ;
const short numLeds = 212;
const byte channelsPerLed = 3;
const short numberOfChannels = numLeds * channelsPerLed;
Adafruit_NeoPixel pixels(numLeds, PIN, NEO_GRB + NEO_KHZ800);
Artnet artnet;
void setup() {
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
pixels.setPixelColor(150, pixels.Color(0, 150, 0));
pixels.show();
delay(300);
pixels.setPixelColor(150,pixels.Color(0,0,150));
pixels.show();
delay(300);
}
Geht man nun wieder einen Schritt weiter, und definiert die Variablen und fügt im Setup auch "artnet.beginn(mac, ip);" ,so geht die Zahl, bei der die LEDs funktionieren auf 202 herunter.
#include <Artnet.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
#include <Adafruit_NeoPixel.h>
const byte PIN = 2 ;
const short numLeds = 202;
const byte channelsPerLed = 3;
const short numberOfChannels = numLeds * channelsPerLed;
Adafruit_NeoPixel pixels(numLeds, PIN, NEO_GRB + NEO_KHZ800);
Artnet artnet;
const int startUniverse = 0;
const int maxUniverses = numberOfChannels / 512 + ((numberOfChannels % 512) ? 1 : 0);
bool universesReceived[maxUniverses];
bool sendFrame = 1;
int previousDataLength = 0;
// Change ip and mac address for your setup
byte ip[] = {10, 0, 1, 199};
byte mac[] = {0x04, 0xE9, 0xE5, 0x00, 0x69, 0xEC};
byte broadcast[] = {10, 0, 1, 255};
void setup() {
artnet.begin(mac, ip);
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
pixels.setPixelColor(150, pixels.Color(0, 150, 0));
pixels.show();
delay(300);
pixels.setPixelColor(150,pixels.Color(0,0,150));
pixels.show();
delay(300);
}
Also liegt das Problem direkt in der Artnet Library denke ich. Ich habe mir diese angesehen, jedoch bin ich nicht in der Lage (mangels Kenntnissen) dort ein Problem zu finden.
Ich habe diese im Anhang beigefügt, vielleicht kannst du etwas finden...
Ps. Vielen Dank für deine Hilfe - bin echt dankbar!!!
Artnet.cpp (5.77 KB)
Artnet.h (4.03 KB)