const int buttonPin1 = 2; // pin-i i butonit 1
const int buttonPin2 = 3; // pin-i i butonit 2
const int ledPin = 13; // pin-i i LED-it
int buttonState1 = 0; // gjendja e butonit 1
int buttonState2 = 0; // gjendja e butonit 2
void setup() {
pinMode(ledPin, OUTPUT); // vendos pin-in e LED-it si output
pinMode(buttonPin1, INPUT); // vendos pin-in e butonit 1 si input
pinMode(buttonPin2, INPUT); // vendos pin-in e butonit 2 si input
}
void loop() {
buttonState1 = digitalRead(buttonPin1); // lexo gjendjen e butonit 1
buttonState2 = digitalRead(buttonPin2); // lexo gjendjen e butonit 2
// kontrollo nëse është shtypur butoni 1
if (buttonState1 == HIGH) {
digitalWrite(ledPin, HIGH); // ndiz LED-in
} else if (buttonState2 == HIGH) { // kontrollo nëse është shtypur butoni 2
digitalWrite(ledPin, LOW); // fik LED-in
}
}