// A B C D E F G
byte NumPinSeg []={17,16,6,7,8,9,10};
void Affiche7seg(int nbr);
int intervale=1000;
unsigned char Lut_7seg [16][7] = {
// A B C D E F G
{ 1, 1, 1, 1, 1, 1, 0}, // 0
{ 0, 1, 1, 0, 0, 0, 0}, // 1
{ 1, 1, 0, 1, 1, 0, 1}, // 2
{ 1, 1, 1, 1, 0, 0, 1}, // 3
{ 0, 1, 1, 0, 0, 1, 1},
{ 1, 0, 1, 1, 0, 1, 1}, // 5
{ 1, 0, 1, 1, 1, 1, 1},
{ 1, 1, 1, 0, 0, 0, 0},
{ 1, 1, 1, 1, 1, 1, 1},
{ 1, 1, 1, 1, 0, 1, 1},
{ 1, 1, 1, 0, 1, 1, 1},
{ 0, 0, 1, 1, 1, 1, 1},
{ 1, 0, 0, 1, 1, 1, 0},
{ 0, 1, 1, 1, 1, 0, 1},
{ 1, 0, 0, 1, 1, 1, 1},
{ 1, 0, 0, 0, 1, 1, 1} // F
};
void setup() {
// put your setup code here, to run once:
for(int i=0;i<7;i++)
{
pinMode(NumPinSeg[i],OUTPUT);
digitalWrite(NumPinSeg [i], LOW);
}
}
int indice=0;
void loop() {
// put your main code here, to run repeatedly:
Affiche7seg(indice);
delay(500);
indice++;
if ( indice>15) indice=0;
}
void Affiche7seg(int nbr)
{
for (int i=0;i<7;i++)
{
byte etatseg=Lut_7seg[nbr][i];
digitalWrite(NumPinSeg[i],etatseg);
}
}