claudeheintz / LXDMXEthernet_library

Library for Arduino with Ethernet Shield implements Art-Net and sACN with example DMX output using USART serial
BSD 3-Clause "New" or "Revised" License
26 stars 6 forks source link

Add another Universe and pool reply #1

Closed folny closed 8 years ago

folny commented 8 years ago

Hi

Please you can manage this library just as you did with the library LXDMXWiFi_Library so that it can be used a greater amount of the Universe and also to function settings ArtNet pool reply thanks :-)

claudeheintz commented 8 years ago

This library is updated to match the LXWiFiDMX library. However, this library is designed to work on ATmega328 processors which have far less memory than the ESP8266. That library has plenty of memory to support full merge of two streams into two universes. The Arduino Uno does not. This library does not support merging from separate network sources. In fact, there is not even an array of bytes for storing DMX values separate from that used for the incoming packet data.

folny commented 8 years ago

Thank you for having so quickly modified the library is really great. Can you help me please because I have a problem when you add a second Universe and poll reply library is not working properly test with neopixel library that is part of the code Please advise me exactly what wording should look like the code to work properly function poll reply thanks.

 void loop() {
uint16_t r,g,b;
uint8_t i;

uint8_t read_result = Universe0->readDMXPacket(eUDP);
uint8_t read_result2 = 0;
// read a packet and if the packet is dmx, write its data to the pixels
if ( read_result ) {
for (int p=0; p<170; p++) {
  // for each NeoPixel find the slot number (each takes 3 slots for RGB)
  i = 3*p;
  r = Universe0->getSlot(i+1);  // Red
  g = Universe0->getSlot(i+2);  // Green
  b = Universe0->getSlot(i+3);  // Blue
  // gamma correct
  r = (r*r)/255;    
  g = (g*g)/255;
  b = (b*b)/255;
  // write to NeoPixel Driver
  leds.setPixelColor(p, r, g, b);
}
// send to NeoPixel Ring
leds.show();
}
  if ( read_result2 = Universe1->readDMXPacket(eUDP)); {
  for (int p=170; p<340; p++) {
  // for each NeoPixel find the slot number (each takes 3 slots for RGB)
  i = 3*p;
  r = Universe1->getSlot(i+1);  // Red
  g = Universe1->getSlot(i+2);  // Green
  b = Universe1->getSlot(i+3);  // Blue
  // gamma correct
  r = (r*r)/255;    
  g = (g*g)/255;
  b = (b*b)/255;
  // write to NeoPixel Driver
  leds.setPixelColor(p, r, g, b);
}
// send to NeoPixel Ring
leds.show();

} }