byte pole[5] = {
0b00111111,
0b00000110,
0b01011011,
0b01100110,
0b01101101
};
bool test = true;
int cislo = 0;
void setup() {
DDRB &= ~(1<<0);
PORTB |= (1<<0);
PORTD = pole[cislo];
DDRD |= 0b01111111;
}
void loop()
{
if ((PINB & (1<<0)) == 0 && test == true )
{
test = false;
if(cislo < 5)
cislo ++;
else
cislo = 0;
PORTB = pole[cislo];
}
else if ((PINB & (1<<0)) != 0 && test != true )
{
test = true;
}
}