const int BIT_PINS[3] = {10, 9, 8}; // LSB to MSB
const int EN_PIN = 11;
void setup() {
for (int i = 0; i < 3; i++) {
pinMode(BIT_PINS[i], OUTPUT);
}
pinMode(EN_PIN, OUTPUT);
}
void loop() {
for (int count = 0; count < 8; count++) { // count 0 - 7
digitalWrite(EN_PIN, LOW); // blank whilst bit shuffling
for (int pin = 0; pin < 3; pin++) { // 3 bits, 0 - 2
digitalWrite(BIT_PINS[pin], (count >> pin) & 1);
}
digitalWrite(EN_PIN, HIGH); // unblank
delay(1000);
}
}