Binary Counting?

Uncompiled, untested

for (int i = 0; i < N_BITS; ++i) {
  digitalWrite (pin [i], bitRead (address, i));
}