Shlink:
I guess I dont understand what is nonsense about it?
Im sorry I just tinker, I am not a programmer by any means.
They're trying to tell you that in your constructor you are wanting to set the values of your instance ("member") variables, yet you are creating local ("function") variables which are "hiding" the instance variables.
You have:
Artnet2::Artnet2()
{
bool matchArtnet = true; // set values of "new" local variables
char _artnetHeader[] = "Art-Net";
int _channel_position = 1;
int _number_of_channels = 512;
// discard the above local variables
// and the instance variables are unaffected
}
In order to assess which buffer size may work for you, you should know the data rate from Udp and on the DMX bus. I mean, you should know how many packets/second are expected from Art-Net, and how fast is the transmission on DMX. I assume that Art-Net is not sending, say, a thousand packets/second when on DMX you can only send 100 packets/second or so, but you should check.
But this is perhaps too complicated and unneeded. The packet size on DMX is 513 byte, and apparently Art-Net is only adding 8 bytes to it. So you need a receive buffer of 521. You check the header and command, but the rest of the packet is retransmitted without changes. So you could just reuse the same buffer as an output buffer in your analogWrite() call, just shifting the beginning of the buffer by 8 bytes. This would save you the memory for the output buffer. And now your data should fit into the Uno's memory no problem.
There are problems in your code, of course. I just saw johncc's answer so I won't repeat it.