If you’re a beginner, don’t use goto. It’s a recipe for bugs that are hard to solve.
if (digitalRead(sen[A1] == HIGH));
else (digitalRead(sen[A2] == HIGH);
So if sen[A1] equals high, do nothing. Further A1 equals 15 (on an Uno, not sure about Mega); so you’re using the 16th element (which by coincedence is A15.
else(digitalRead(sen == HIGH);
Similar comment; however sen is A4, so you read that pin (again).
You also will have to replace most of your ‘else’ by ‘if’; your current (incorrect) implementation will never check any other pins if e.g. A1 is HIGH.
Your good idea was to use an array; the bad idea is the way you used it.
Why do you use LOW for pinMode; although it does the same as using INPUT when used in the pinMode function, it’s less clear what you’re trying to achieve and maybe you’re trying to achieve something completely different. The below proves that both are the same
Serial.print("LOW is "); Serial.println(LOW);
Serial.print("INPUT is "); Serial.println(INPUT);
Assuming you want to set the pins to input, you can loop through the sen array
// display number of elements in sen array to demeonstrate the use of 'sizeof(sen) / sizeof(sen)'
Serial.print("Number of elements in sen array is "); Serial.println(sizeof(sen) / sizeof(sen));
// set all sensor pins to input
for (int senCnt = 0; senCnt < sizeof(sen) / sizeof(sen); senCnt++)
Serial.print("Setting pin ");
Serial.println(" to input");
The above contains some debug info in the hope it makes clear what is happening.
I will continue a little later with loop().