const int motorPin = 9; // Pin-i i motorit
const int buttonPin = 2; // Pin-i i butonit
void setup() {
pinMode(motorPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
if (digitalRead(buttonPin) == HIGH) { // Nëse butoni është shtypur
digitalWrite(motorPin, HIGH); // Aktivizon motorin
delay(2000); // Rrotullimi për 2 sekonda
digitalWrite(motorPin, LOW); // Ãaktivizon motorin
delay(10000); // Pauza 10 sekonda
digitalWrite(motorPin, HIGH); // Rrotullimi në anën tjetër
delay(2000); // Rrotullimi për 2 sekonda
} else {
digitalWrite(motorPin, LOW); // Ãaktivizon motorin nëse butoni nuk është shtypur
}
}