diff --git a/Arduino/McLighting/definitions.h b/Arduino/McLighting/definitions.h index 4b76888..82272ca 100644 --- a/Arduino/McLighting/definitions.h +++ b/Arduino/McLighting/definitions.h @@ -21,7 +21,7 @@ const char HOSTNAME[] = "McLighting01"; // Friedly hostname #ifdef ENABLE_E131 #define UNIVERSE 1 // First DMX Universe to listen for - #define UNIVERSE_COUNT 7 // Total number of Universes to listen for, starting at UNIVERSE + #define UNIVERSE_COUNT 2 // Total number of Universes to listen for, starting at UNIVERSE #endif //#define WIFIMGR_PORTAL_TIMEOUT 180 diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index c15e9f3..dcfee5d 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -11,7 +11,7 @@ void handleE131(){ uint16_t universe = htons(packet.universe); uint8_t *data = packet.property_values + 1; - if (!e131.stats.num_packets || universe < UNIVERSE || universe > UNIVERSE_COUNT) return; + if (universe < UNIVERSE || universe > UNIVERSE_COUNT) return; //async will take care about filling the buffer // Serial.printf("Universe %u / %u Channels | Packet#: %u / Errors: %u / CH1: %u\n", // htons(packet.universe), // The Universe for this packet @@ -20,13 +20,13 @@ void handleE131(){ // e131.stats.packet_errors, // Packet error counter // packet.property_values[1]); // Dimmer data for Channel 1 - uint16_t len = e131.stats.num_packets / 3; + uint16_t len = 170; // (htons(packet.property_value_count) - 1) /3; uint16_t multipacketOffset = (universe - UNIVERSE) * 170; //if more than 170 LEDs (510 channels), client will send in next higher universe if (NUMLEDS <= multipacketOffset) return; if (len + multipacketOffset > NUMLEDS) len = NUMLEDS - multipacketOffset; for (uint16_t i = 0; i < len; i++){ uint16_t j = i * 3; - strip.setPixelColor(i, data[j], data[j + 1], data[j + 2]); + strip.setPixelColor(i + multipacketOffset, data[j], data[j + 1], data[j + 2]); } strip.show(); }