 Servo ServoMotor;
 const uint8_t servoPin = 10;
 
-const uint8_t servoLimitLeft = 10;
-const uint8_t servoTiltLeft = 50;
-const uint8_t servoLimitRight = 170;
-const uint8_t servoTiltRight = 130;
+const uint8_t servoLimitLeft = 170;
+const uint8_t servoTiltLeft = 130;
+const uint8_t servoLimitRight = 10;
+const uint8_t servoTiltRight = 50;
 const uint8_t servoCenter = 90;
 
 enum direction {

  RIGHT
};
direction servoRangeDirection = NONE;

// IR obstacle detection
int obstaclePin = A1;

    }
}


void loop()
{

    uint32_t uptime = millis();
    uint8_t servoPos = ServoMotor.read();

    Serial.print(servoPos);
    Serial.print(" - ");
    Serial.print(rangeLeft);
    Serial.print(" - ");
    Serial.print(rangeCenter);
    Serial.print(" - ");
    Serial.print(rangeRight);
    Serial.print(" - ");
    Serial.println(uptime);



    GetRange(servoPos, wheelSpinCompleted);



    int interval = 1000;
    if(uptime > interval*2 && servoTriggerActive && uptime % interval < 100)
    {
        servoTriggerActive = false;

        if(servoLastScan == RIGHT)
        {
            SetServoAngle(servoTiltLeft);
            servoLastScan = LEFT;
        }
        else
        {
            SetServoAngle(servoTiltRight);
            servoLastScan = RIGHT;
        }
    }
    if(uptime % interval > 100)
    {
        servoTriggerActive = true;
    }
    if(servoPos >= servoTiltLeft || servoPos <= servoTiltRight)
    {
        servoCountHelper--;
    }
    if(servoCountHelper <= 0)
    {
        servoCountHelper = 5;
        SetServoAngle(servoCenter);
    }

    return;





    // Wait for initial scans before performing any actions
    if(uptime < initialDelay)
