#include <Arduino.h>
const uint8_t LATCH_PIN = 9;   // MCU pin, not the 74HC595 latch terminal number (12).
const uint8_t CLOCK_PIN = 10;  // IC clock terminal is 11.
const uint8_t DATA_PIN = 8;    // IC data terminal is 14.
// MSBFIRST places bit 0 at Q0. Here bit 0=a, 1=b, ..., 6=g, 7=decimal point.
const uint8_t GLYPHS[] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
                         0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00};
void displayGlyph(uint8_t number) {
  digitalWrite(LATCH_PIN, LOW);
  shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, GLYPHS[number]);
  digitalWrite(LATCH_PIN, HIGH);
}
void setup() {
  pinMode(LATCH_PIN, OUTPUT); pinMode(CLOCK_PIN, OUTPUT); pinMode(DATA_PIN, OUTPUT);
}
void loop() {
  // The supplied wiring grounds all four digit commons through separate resistors.
  // It shows the SAME glyph on every digit; this sketch does not select or multiplex digits.
  for (uint8_t number = 1; number <= 15; ++number) {
    displayGlyph(number); delay(500);  // 1..9,A,b,C,d,E,F; the supplied loop does not show zero.
  }
}
