USing arrays, binary data and bitRead
There are only two errors I can spot in your program:




A block of code should be delimited by curly braces:

for (count=0; count&lt;8; count++){
    pinMode(pinArray[count],OUTPUT);
}  // ← ‘}’ instead of ‘]’

If a function expects to be passed arguments, these should be
declared as parameters in the function prototype:

void ledDisplay(byte x){  // ← mind the “byte x”
    // ...
}



Other than that, here a few suggestions to make the code look nicer, and
hopefully more maintainable:


indent consistently
use const to qualify constants
use named constants instead of magic numbers
keep variables local if possible
note that an int that is either 0 or 1 is equivalent to a boolean
use pinArray[] for accessing the pins


Applying those suggestions, I get the following:

const int PIN_COUNT = 8;
const int pinArray[PIN_COUNT] = { 2, 3, 4, 5, 6, 7, 8, 9 };
const int CODE_COUNT = 6;
const int code1[CODE_COUNT] = {
    B10101010, B01010101, B10101010, B01010101, B10101010, B01010101
};

void setup() {
    for (int count = 0; count &lt; PIN_COUNT; count++) {
        pinMode(pinArray[count], OUTPUT);
    }
}

void loop() {
    for (int count = 0; count &lt; CODE_COUNT; count++) {
        ledDisplay(code1[count]);
    }
}

void ledDisplay(byte x) {
    for (int split = 7; split &gt;= 0; split--) {
        if (bitRead(x, split)) {
            digitalWrite(pinArray[split], HIGH);
        } else {
            digitalWrite(pinArray[split], LOW);
        }
    }
}