for (int i = 0; i < 5; i++) { // Move the wiper in one direction digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); delay(1000); // Delay for 1 second
// Stop the wiper
digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW); delay(1000); // Delay for 1 second
// Move the wiper in the opposite direction
digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); delay(1000); // Delay for 1 second
// Stop the wiper
digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW); delay(1000); // Delay for 1 second } }