int ledPin = 8;
int tipka = 2;
volatile byte stanje = LOW;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
pinMode(tipka, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(tipka), ISR_tipka, FALLING);
}
void loop() {
digitalWrite(ledPin,stanje);
//delay(500);
}
void ISR_tipka(){
stanje = !stanje;
}