   return microseconds / 29 / 2;
 }
 
-//voidsweep moet nog aangeroepen worden
-void sweepforward(int NUM_OF_CYCLES) {
+/*voidsweep moet nog aangeroepen worden*/
+void SweepForward(int NUM_OF_CYCLES) {
   for (int j = 1; j < NUM_OF_CYCLES; j++)
     for (pos = 0; pos = 170; pos += 1)
     { servo.write(pos);
       delay(100);
     }
+    
 }

  Serial.println();

  buttonState = digitalRead(buttonPin);
  if (buttonState != lastButtonState) {
    if (buttonState == HIGH) {
      buttonPushCounter++;
    }
    delay(50);
  }

  //servo
  if (cm <= 10) {
    sweepforward(3);
  }
  else if (cm >= 24) {
    servo.write(pos);

Servo servo;

// consisent
const int buttonPin = 2;                      //
const int trigPin = 6;                        //
const int echoPin = 7;                        //
const int servoPin = 13;                      //

// Variable
int buttonPushCounter = 0;                  // counter for the number of button presses
int buttonState = 0;                        // current state of the button
int lastButtonState = 0;                    // previous state of the button
int pos = 0;                                //
int cm;                                     //
int duration;                               //


void setup () {
  pinMode(buttonPin, INPUT);
