const int dataPin = 2;   /* DS */
const int clockPin = 3;  /* SHCP */
const int latchPin = 4;  /* STCP */

uint8_t display7seg[16] = {0x7E, 
0x30, 0x6D, 0x79, 0x33, 0x5B, 0x5F, 
0x70, 0x7F, 0x7B, 0x77, 0x1F, 0x4E, 0x3D, 0x4F, 0x47};

void updateDisplay(uint8_t valor);

void setup() {
  // put your setup code here, to run once:
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(latchPin, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  for (int i = 0; i <= 15; i++){
    updateDisplay(~display7seg[i]);
  }
}

void updateDisplay(uint8_t valor){
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, valor);
  digitalWrite(latchPin, HIGH);
  delay(500);
}
74HC595
74HC595