byte segment
byte segment2[] =
{
0b01101111
};
int cislo1, cislo = 0;
void setup ()
{
DDRB &= ~(1 << 1);
PORTB |= (1 << 1);
DDRD = 0b11111111;
PORTD = 0b00000000;
}
void loop()
{
if (!(PINB & (1 << 1)))
{
PORTD = segment2[cislo1];
delay(1000);
}
else
{
PORTD = 0b00000000;
cislo = (cislo + 1) % 10;
delay(1000);
}
}