What is the simplest way to "ask" the arduino which input pins are HIGH? I am trying to build a 36-line cable tester, using the Digistump DigiX (99 i/o pins). Digital pins 0-35 are outputs, connected via the cable in question, to (in a perfect world) digital input pins 36-72. The plan is to have 36 neopixels (to conserve DigiX pins), one corresponding to each line in the cable. Currently they light up green for connection and red for no connection.

It's easy to check if output 0 goes to input 36, but there are more potential problems in a cable than no connection... 

What if there is a short and output 0 goes to 36 and 42? It will still show up as correct when it tests 0 to 36... I somehow need to "ask" it what, if any, inputs (pins 36-72) are HIGH when only output 0 is HIGH.

I'm not sure how I'm going to display this extra data yet (Lcd maybe? Or maybe any pins shorted together all use a unique led color...), but I want to make sure the idea will work before I move on to that. Here is what I have working so far, just using a 3-line cable for now. And yes, I'm new to this. Any advice would be greatly appreciated!

#include &lt;FastLED.h&gt;
#define NUM_LEDS 3
#define LED_PIN 6
CRGB leds[NUM_LEDS];
#define brightness 25
int var = 0;

void setup() {
  for (int sendPins=0; sendPins &lt;= 2; sendPins++) {
    pinMode(sendPins, OUTPUT); }

  for (int recPins=3; recPins &lt;= 5; recPins++) {
    pinMode(recPins, INPUT); }

    FastLED.addLeds&lt;NEOPIXEL, LED_PIN&gt;(leds, NUM_LEDS);
    FastLED.clear();
}

void loop() {
  while (var &lt; 3) {    //so it only runs once for each line in the cable.
    var++;
  for (int sendPins=0; sendPins &lt; 3; sendPins++) {
    digitalWrite(sendPins, HIGH);

    int recPins = map(sendPins, 0, 2, 3, 5);  //made more sense to me than another for loop.

     int recPin = digitalRead(recPins);
     if (recPin == HIGH)
     {
      leds[sendPins].g = brightness;
      leds[sendPins].r = 0;
      FastLED.show();
     }
     else
     {
      leds[sendPins].r = brightness;
      leds[sendPins].g = 0;
      FastLED.show();
     }

      digitalWrite(sendPins, LOW);
      delay(250);      //just for testing so i know it's going through them all.
  }
 }
}
There is a technique, which I used some 40 years ago to test for changes on a set of input pins. This can easily be configured to test serially. 

Put a 1 on an output pin say 5. Create an integer e.g. 010000 with a 1 in the appropriate position. Read ALL inputs and XOR with the created integer. If one and only one input is 1 the resultant value will be 0. This is easy to implement in a loop just by shifting the 1 left each time.

The technique works if you can read all inputs into a integer. This was OK for our 32 bits, but could be extended.

It is probably easier to code than explain, but depends on what you have to do to read all inputs.