byte load[] = {0b00000010, 0b00000100, 0b10000000, 0b01000000};
byte zmeyka[] = { 0b00000011, 0b00000100, 0b10000000, 0b00100000, 0b00010000, 0b0001000, 0b10000000, 0b01000000 };
/*byte getSegments(int value){
switch (value){
case 0: return 0b01111110;
case 1: return 0b00001100;
case 2: return 0b10110110;
case 3: return 0b10011110;
case 4: return 0b11001100;
case 5: return 0b11011010;
case 6: return 0b11111010;
case 7: return 0b00001110;
case 8: return 0b11111110;
case 9: return 0b11011110;
case 10: return 0b11101110;
case 11: return 0b11111000;
case 12: return 0b01110010;
case 13: return 0b10111100;
case 14: return 0b11110010;
case 15: return 0b11100010;
}
}*/
int size_load;
void setup() {
size_load = sizeof(load);
for (int i = 1; i <= 7; i++){
pinMode(i, OUTPUT);
}
}
// 00001100 << 00011000
// 00001110 | 00000011 = 00001111
void loop() {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < size_load; j++) {
PORTD = load[j] ^ 0b11111111;
delay(500);
}
}
PORTD = 0b00000000;
delay(200);
PORTD = 0b1111111;
delay(200);
PORTD = 0b00000000;
delay(200);
PORTD = 0b1111111;
delay(200);
PORTD = 0b00000000;
delay(500);
for (int i=0; i< sizeof(zmeyka); i++){
PORTD = zmeyka[i]^0b11111111;
delay(500);
}
}