vary the dsipplay of a seven-segment display with a potentiometer

i would like to know if it possible to vary the display of a seven segments display with a potentiometer ??
i tryed with this program but the seven segments display stay completly lit...i also tryed with delay() between each conditions but that's the same result... someone can help me plz ?? Here is my program :(afficheur = display) :

int leda = 7;
int ledb = 6;
int ledc = 4;
int ledd = 2;
int lede = 1;
int ledf = 9;
int ledg = 10;
int pot = A0;
int potvalue = 0;
int afficheur = 0;
void setup() {
Serial.begin(9600);
pinMode(leda,OUTPUT);
pinMode(ledb,OUTPUT);
pinMode(ledc,OUTPUT);
pinMode(ledd,OUTPUT);
pinMode(lede,OUTPUT);
pinMode(ledf,OUTPUT);
pinMode(ledg,OUTPUT);
pinMode(pot,INPUT);

}

void loop() {
Serial.println(afficheur);
potvalue = analogRead(pot);
afficheur = map(potvalue, 0, 1023, 0, 10);

if(afficheur==0){analogWrite(leda,1);
analogWrite(ledb,1);
analogWrite(ledc,1);
analogWrite(ledd,1);
analogWrite(lede,1);
analogWrite(ledf,1);
analogWrite(ledg,0);}
else{};

if(afficheur==1){analogWrite(leda,1);
analogWrite(ledb,0);
analogWrite(ledc,0);
analogWrite(ledd,1);
analogWrite(lede,1);
analogWrite(ledf,1);
analogWrite(ledg,1);}
else{};

if(afficheur==2){analogWrite(leda,0);
analogWrite(ledb,0);
analogWrite(ledc,1);
analogWrite(ledd,0);
analogWrite(lede,0);
analogWrite(ledf,1);
analogWrite(ledg,0);}
else{};

if(afficheur==3){analogWrite(leda,0);
analogWrite(ledb,0);
analogWrite(ledc,0);
analogWrite(ledd,0);
analogWrite(lede,1);
analogWrite(ledf,1);
analogWrite(ledg,0);}
else{};

if(afficheur==4){analogWrite(leda,1);
analogWrite(ledb,0);
analogWrite(ledc,0);
analogWrite(ledd,1);
analogWrite(lede,1);
analogWrite(ledf,0);
analogWrite(ledg,0);}
else{};

if(afficheur==5){ analogWrite(leda,0);
analogWrite(ledb,1);
analogWrite(ledc,0);
analogWrite(ledd,0);
analogWrite(lede,1);
analogWrite(ledf,0);
analogWrite(ledg,0);}
else{};

if(afficheur==6){analogWrite(leda,0);
analogWrite(ledb,1);
analogWrite(ledc,0);
analogWrite(ledd,0);
analogWrite(lede,0);
analogWrite(ledf,0);
analogWrite(ledg,0);}
else{};

if(afficheur==7){analogWrite(leda,0);
analogWrite(ledb,0);
analogWrite(ledc,0);
analogWrite(ledd,1);
analogWrite(lede,1);
analogWrite(ledf,1);
analogWrite(ledg,1);}
else{};

if(afficheur==8){analogWrite(leda,0);
analogWrite(ledb,0);
analogWrite(ledc,0);
analogWrite(ledd,0);
analogWrite(lede,0);
analogWrite(ledf,0);
analogWrite(ledg,0);}
else{};

if(afficheur==9){analogWrite(leda,0);
analogWrite(ledb,0);
analogWrite(ledc,0);
analogWrite(ledd,0);
analogWrite(lede,1);
analogWrite(ledf,0);
analogWrite(ledg,0);}
else{};

}

Use “digitalWrite()”

i've to use digitalWrite instead of analogWrite ?

And pin 1 (lede) is used by Serial on most arduinos.

thx it works !