Hello, I was reviewing the example code and the readme. It states to create a buffer for each universe using:
ESPAsyncE131 e131(UNIVERSE_COUNT);
Where is am lost is how do I increment the universe when pulling packets in the following code? I see e131.pull but was not sure how to increment.
`e131_packet_t packet;
e131.pull(&packet); // Pull packet from ring buffer
Serial.printf("Universe %u / %u Channels | Packet#: %u / Errors: %u / CH1: %u\n",
htons(packet.universe), // The Universe for this packet
htons(packet.property_value_count) - 1, // Start code is ignored, we're interested in dimmer data
e131.stats.num_packets, // Packet counter
e131.stats.packet_errors, // Packet error counter
packet.property_values[1]); // Dimmer data for Channel 1`
I am trying to write a simple piece of code for assessing frames per second processing, but I am lost on how to get to the last channel. For my code I will need to get to the last channel of the last universe, but I am unclear how to get there. I am sure it is simple, but unfortunely programming in Arduino language is not my strong point. Any help appreciated.
FYI I did try simply increasing the number 1 to the last channel I am sending from xlights, but that did not work.
Hello, I was reviewing the example code and the readme. It states to create a buffer for each universe using:
ESPAsyncE131 e131(UNIVERSE_COUNT);
Where is am lost is how do I increment the universe when pulling packets in the following code? I see e131.pull but was not sure how to increment.
`e131_packet_t packet; e131.pull(&packet); // Pull packet from ring buffer
I am trying to write a simple piece of code for assessing frames per second processing, but I am lost on how to get to the last channel. For my code I will need to get to the last channel of the last universe, but I am unclear how to get there. I am sure it is simple, but unfortunely programming in Arduino language is not my strong point. Any help appreciated.
FYI I did try simply increasing the number 1 to the last channel I am sending from xlights, but that did not work.