int seznam1[] = {1, 2, 16, 64, 128, 255, 1024, 2048};
int pin[] = {0, 1, 2, 3, 4, 5, 8, 9};
void setup() {
Serial.begin(115200); // Uncomment if you want to use Serial
//DDRD = 0xFF; // all pins are output
for (int x = 0; x < 8; x++) {
pinMode(pin[x], OUTPUT); // Corrected pinMode argument
}
}
void loop() {
static int index = 0;
int i = seznam1[index];
int m = sizeof(seznam1) / sizeof(seznam1[0]);
Serial.println(m);
for (int x = 0; x < 8; x++) {
int k = i & 0x01;
digitalWrite(pin[x], k);
i = i >> 1;
}
index++;
if (index >= m) index = 0;
delay(300);
}