int seznam[] = { 1, 2, 4 ,8 ,16, 32, 64, 128, 255, 0, 255, 0, 255, 0, 255, 0};
int buttonPin = 8;
int buttonState = LOW;
int pin[] = {0,1,2,3,4,5,9,10};
void setup() {
// put your setup code here, to run once:
//Serial.begin(115200);
//DDRD = 0xff;
for (int x = 0; x < 8; x++){
pinMode(x, OUTPUT);
}
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
static int index = 0;
int i = seznam[index];
buttonState = digitalRead(buttonPin);
// put your main code here, to run repeatedly:
if (buttonState == LOW){
for (int x = 0; x < 8; x++) {
int k = i & 0x01;
digitalWrite(pin[x], k);
i = i >> 1;
}
index++;
if (index> sizeof(seznam)/sizeof(seznam[0])) index = 0;
delay(300);
}
}