int seznam[] = {1, 2, 4, 6, 8, 10, 12, 14, 16};
int seznam1[] = {16, 14, 12, 10, 8, 6, 4, 2, 1};
int check = 0;
void setup() {
// Port D, pins 3 and 2 set to input_pullup:
DDRD &= 0xF3;
PORTD = 0b00001100;
// Serial communication start:
Serial.begin(115200);
}
void loop() { // delimo s številom bitov, ki jih zasede ena spremenljivka
// Reading both buttons:
int buttOn = PIND & 0x08;
int buttOff = PIND & 0x04;
// if blue button is held:
if (buttOn == 0){
check = 1;
}
// if red button is held:
else if (buttOff == 0){
check = 0;
}
// print of seznam:
if (check == 1){
for(int x = 0; x < (sizeof(seznam) / sizeof(seznam[0])); x++){
Serial.println(seznam[x]);
delay(350);
}
}
// print of seznam1:
else {
for(int x = 0; x < (sizeof(seznam1)/sizeof(seznam1[0])); x++){
Serial.println(seznam1[x]);
delay(350);
}
}
}
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
btn2:1.l
btn2:2.l
btn2:1.r
btn2:2.r