int LedPin[] = {1, 2, 4, 8, 16, 32, 64, 128, 255, 0};
int Pin1[] = {0x81, 0x42, 0x24, 0x18, 0x24, 0x42, 0x81};
void setup() {
DDRD = 0xFF;
DDRB &= 0xFE;
}
void loop() {
bool stikalo = PINB & 0x01;
if (stikalo == HIGH){
for(int x = 0; x < (sizeof(LedPin) / sizeof(LedPin[0])); x++){
PORTD = LedPin[x];
delay(300);
}
}
else{
for(int x = 0; x < 7; x++){
PORTD = Pin1[x];
delay(300);
}
}
}