byte znaky[] = 
{
  0b0111111,
  0b0000110,
  0b1011011,
  0b1001111,
  0b1100110,
  0b1101101,
  0b1111101,
  0b0000111,
  0b1111111,
  0b1101111,
};
byte cisloPred = 0;
byte cislo = 0;
bool t = true;
bool stupanie = true;


void setup() 
{
  DDRD = 0b11111111;
  DDRB = 0;
  PORTB |= 1<<5;
}

void loop() 
{
  if((PINB & (1<<5)) != 0 && t == true)
  {
    t = false;
    if(stupanie == true)
    {
      cislo++;
    }
    else
    {
      cislo--;
    }
    if(cislo == 9)
    {
      stupanie = false;
    }
    if(cislo == 0)
    {
      stupanie = true;
    }
    
  }
  if((PINB & (1<<5)) == 0 && t == false)
  {
    t = true;
  }
  
  PORTD = znaky[cislo];
  
}