int pinButton = 7;
int tipka;
int LED = 3;
void setup() {
pinMode(pinButton, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
tipka = digitalRead(pinButton);
if (tipka == LOW) digitalWrite(LED, LOW);
else digitalWrite(LED, HIGH);
delay(500);
}
/*
void setup() {
pinMode(7, INPUT_PULLUP);
Serial.begin(115200);
}
void loop() {
tipka = digitalRead(pinButton);
if (tipka == LOW) Serial.println("tipka pritisnjena");
else Serial.println("tipka ni pritisnjena");
delay(500);
}
*/