int seznam[] = {1, 2, 4, 6, 8, 10, 12};
int seznam1[] = {3, 5, 7, 9, 11, 13, 15};
int tipka1 = 7;
int tipka2 = 6;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(tipka1, INPUT_PULLUP);
pinMode(tipka2, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
/*
for (int x = 0; x < 7; x++) {
Serial.println(seznam[x]);
delay(500);
}
*/
/*for (int x = 0; x < (sizeof(seznam) / sizeof(seznam[0])); x++) {
Serial.println(seznam[x]);
delay(500);
}*/
/*
int vrednost = digitalRead(tipka1);
if (vrednost == 0) {
for (int x = 0; x < (sizeof(seznam) / sizeof(seznam[0])); x++) {
Serial.println(seznam[x]);
delay(500);
}
}
else {
for (int x = 0; x < (sizeof(seznam1) / sizeof(seznam1[0])); x++) {
Serial.println(seznam1[x]);
delay(500);
}
}*/
// rdeca(tipka2) na sodo, zelena na liho
static int vrednost;
if (digitalRead(tipka2) == 0) vrednost = 0;
else if (digitalRead(tipka1) == 0) vrednost = 1;
if (vrednost == 0) {
for (int x = 0; x < (sizeof(seznam) / sizeof(seznam[0])); x++) {
Serial.println(seznam[x]);
delay(500);
}
}
else {
for (int x = 0; x < (sizeof(seznam1) / sizeof(seznam1[0])); x++) {
Serial.println(seznam1[x]);
delay(500);
}
}
}