int cislo = 0;
int piny[] = {0,1,2,3,4,5,6};
bool blok = true;
void setup()
{
for(int i = 0; i < 7; i++)
{
pinMode(i, OUTPUT);
}
pinMode(A0, INPUT_PULLUP);
}
int pole[10][7] =
{
{1,1,1,1,1,1,0},
{0,1,1,0,0,0,0},
{1,1,0,1,1,0,1},
{1,1,1,1,0,0,1},
{0,1,1,0,0,1,1},
{1,0,1,1,0,1,1},
{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}
};
void loop()
{
if(digitalRead(A0) == LOW && blok == true)
{
blok = false;
cislo++;
if (cislo > 9)
{
cislo = 0;
}
}
if(digitalRead(A0) == HIGH && blok == false)
blok = true;
for (int i = 0; i < 7; i++)
{
digitalWrite(piny[i], pole[cislo][i]);
}
delay(100);
}