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

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

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