 const uint8_t servoPin = 6;
 const uint8_t servoRotationAngel = 10;
 
+enum direction {
+  left,
+  center,
+  right
+};
+
 uint8_t servoPos = 90;
-bool servoDirectionRight = false;
-bool servoRight = false;
+direction servoMovement = right;
+direction servoLocation = center;
+
 
 void setup()
 {

    {
        servoPos -= servoRotationAngel;
    }

    // todo - center would be nice as well
    if(servoPos >= 90) { servoRight = true; } else { servoRight = false; }

    return servoPos;
}


uint8_t GetNextServoAngle()
{
    // 0 - 80
    // 80 - 100
    // 100 - 180

    if(servoPos <= 0)
    {
        servoLocation = left;
        servoMovement = right;
        servoPos = 0;
    }

    if(servoPos < 80)
    {
        servoLocation = left;
    }

    if(servoPos >= 80 && servoPos <= 100)
    {
        servoLocation = center;
    }

    if(servoPos > 100)
    {
        servoLocation = right;
    }

    if(servoPos >= 180)
    {
        servoLocation = right;
        servoMovement = left;
        servoPos = 180;
    }


    if(servoMovement == right)
    {
        servoPos += servoRotationAngel;
    }
