32 bit binary counter

So you are converting a 5 bit value into lighting LED's? Quite simple..

const byte BITPINS[] = {One, Two, Four, Eight, Sixteen};
for (byte i = 1; i <= 32; i++) {
  for (byte bit = 0; bit < 5; bit++) digitalWrite(BITPINS[bit], (i & (1 << bit)) ? HIGH : LOW);
  delay(timer);
}

EDIT: Corrected a brain fart..