#define A 1
#define B 2
#define C 3
#define D 4
#define E 5
#define F 6
#define G 7
 
void display(int szam)
{
  switch(szam)
  {
 
    case 0 :
    digitalWrite(A, LOW);
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    digitalWrite(D, LOW);
    digitalWrite(E, LOW);
    digitalWrite(F, LOW);
    digitalWrite(G, LOW);
    break;
    case 1 :
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    break;
    case 2 :
    digitalWrite(A, LOW);
    digitalWrite(B, LOW);
    digitalWrite(D, LOW);
    digitalWrite(E, LOW);
    digitalWrite(G, LOW);
    break;
    case 3 :
    digitalWrite(A, LOW);
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    digitalWrite(D, LOW);
    digitalWrite(G, LOW);
    break;
    case 4 :
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    digitalWrite(F, LOW);
    digitalWrite(G, LOW);
    break;
    case 5 :
    digitalWrite(A, LOW);
    digitalWrite(C, LOW);
    digitalWrite(D, LOW);
    digitalWrite(F, LOW);
    digitalWrite(G, LOW);
    break;
    case 6 : 
    digitalWrite(A, LOW);
    digitalWrite(C, LOW);
    digitalWrite(D, LOW);
    digitalWrite(E, LOW);
    digitalWrite(F, LOW);
    digitalWrite(G, LOW);
    break;
    case 7 : 
    digitalWrite(A, LOW);
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    break;
    case 8 : 
    digitalWrite(A, LOW);
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    digitalWrite(D, LOW);
    digitalWrite(E, LOW);
    digitalWrite(F, LOW);
    digitalWrite(G, LOW);
    break;
    case 9 :
    digitalWrite(A, LOW);
    digitalWrite(B, LOW);
    digitalWrite(C, LOW);
    digitalWrite(D, LOW);
    digitalWrite(F, LOW);
    digitalWrite(G, LOW);
    break;
 
  }
}
void setup() {
  // put your setup code here, to run once:
pinMode(A, OUTPUT);
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
pinMode(E, OUTPUT);
pinMode(F, OUTPUT);
pinMode(G, OUTPUT);
}
 
void loop() {
    for(int i=0;i<=9;i++){
 digitalWrite(B, HIGH);
    digitalWrite(C, HIGH);
    digitalWrite(A, HIGH);
    digitalWrite(D, HIGH);
    digitalWrite(E, HIGH);
    digitalWrite(F, HIGH);
    digitalWrite(G, HIGH);
    display(i);
    delay(500);}
  }
 
//}