Código de Inicio para ejercicios con Display

#define BUTTON1 A1
#define BUTTON2 A2
#define BUTTON3 A3

#define LED1 13
#define LED2 12
#define LED3 11
#define LED4 10

#define POTE A0
#define BUZZER 3

#define LATCH 4
#define CLOCK 7
#define DATA 8

#define NEG 5
#define POS 6
#define SW 9
 
/* Segment byte maps for numbers 0 to 9 */
const byte SEGMENT_MAP[] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0X80,0X90};
/* Byte maps to select digit 1 to 4 */
const byte SEGMENT_SELECT[] = {0xF1,0xF2,0xF4,0xF8};
 
void setup ()
{

pinMode(LATCH,OUTPUT);
pinMode(CLOCK,OUTPUT);
pinMode(DATA,OUTPUT);

pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
pinMode(LED4,OUTPUT);

pinMode(BUZZER,OUTPUT);

digitalWrite(LED1,HIGH);
digitalWrite(LED2,HIGH);
digitalWrite(LED3,HIGH);
digitalWrite(LED4,HIGH);
digitalWrite(BUZZER,HIGH);

pinMode(NEG,OUTPUT);
digitalWrite(NEG,LOW);
pinMode(POS,OUTPUT);
digitalWrite(POS,HIGH);
pinMode(SW,INPUT);

Serial.begin(9600);

}
 
/* Main program */
void loop()
{

  
}
 
void SetDisplay(int number) {
  SetDigito(0 , number / 1000);
  SetDigito(1 , (number / 100) % 10);
  SetDigito(2 , (number / 10) % 10);
  SetDigito(3 , number % 10);
}

void SetDigito(byte Segment, byte Value)
{
  digitalWrite(LATCH,LOW);
  shiftOut(DATA, CLOCK, MSBFIRST, SEGMENT_MAP[Value]);
  shiftOut(DATA, CLOCK, MSBFIRST, SEGMENT_SELECT[Segment] );
  digitalWrite(LATCH,HIGH);
}