Problem: UDP Wraped with If Statement

We've been telling you that you need to put debug Serial.print() statements in the code. You've, apparently, identified a block of code that causes the Arduino to stop doing useful work. So, which of those three statements causes the problem?

Ok so I added Serial.print() to each line in the UDP code block. The first two are executed but the Udp.endPacket(); is NOT executed! So I guess that's why the loop doesn't work properly and nothing is sent over.

What sized values does muxShield.digitalReadMS() actually return? The values appear to be 0 or 1, so, why do you need to store those in an int? Why do you need, on every pass through loop to store 48 ones on three arrays? You use the 48 elements to determine if v1, v2, and v3 are not the same as the 1 stored in the array. Why not just compare v1, v2, and v3 to 1, and get rid of the 96 wasted bytes?

the muxShield.digitalReadMS() returns 0's and 1's. It returns 0 when an object is detected by the sensor and returns 1 if there's nothing detected. The reason why I created three different arrays is because I have three different rows on my muxShield which increases the number of my digital inputs. Paul, I'm a beginner programmer so that was the only way that came into my mind. And about the storing them in an "int" it was the only way that I thought was correct, so feel free to suggest any other way you think is better for this purpose.

Finally, a link to the shield you are using, and the library, would be good. I'm beginning to suspect a pin conflict.

My Arduino is an Arduino Uno.

Links for the shields:

Muxshield: Mux Shield | Mayhew Labs

Ethernet Shield: Ethernet shield module w5100 micro sd card slot for mega 2560 geekcreit for arduino - products that work with official arduino boards Sale - Banggood.com sold out-arrival notice-arrival notice

this ethernet shield is a cheaper equivalent to the Arduino ethernet shield,