VarSpedd Servo 0-180

Hi Guys

I’ve a problem

I had a Servo SM-S2309S with them I wanted that, he turn from 0 to 90 to 180 deegres and back. It works, but the Servo didnt reach 180 deegres, so I buyed a Motor with 360 deegrees. But now it doesnt works with the old code and only turns endless and the turn back. What’s wrong?
please help the sketch is here

#include <VarSpeedServo.h>
VarSpeedServo servo;
#include <LiquidCrystal.h> // include libary
LiquidCrystal lcd(12,11,5,4,3,2); // connected Pin’s with the Lcd
int const Poti= A0;
int potVal = 0;
int analogservo;

int servoSpeeds = 20;
int doublespeed = 40;
int servoneun = 90; // the maximum servo angle
int servosechzig = 160;
int servoposition = 0;

void setup() {
int const Poti = A0;
pinMode(analogservo,OUTPUT);
servo.attach(9);

servo.slowmove(servoposition,servoSpeeds) ;

}

void loop() {

if(servo.read() == servoposition)

{
servo.slowmove(servoneun,servoSpeeds) ;
lcd.clear();

lcd.print (“0”);
lcd.print(" Grad");
delay(4000);

}

else if(servo.read() == servoposition + 90)

{
servo.slowmove(servosechzig,servoSpeeds) ;
lcd.clear();
delay(4000);

lcd.print (“160”);
lcd.print(" Grad");
delay(4000);
}
else if(servo.read() == servoposition + 160)
{servo.slowmove(servoneun,doublespeed) ;
lcd.clear();

lcd.print (“90”);
lcd.print(" Grad");
delay(4000);

servo.slowmove(servoposition,doublespeed);
lcd.clear();

lcd.print (“0”);
lcd.print(" Grad");
delay(4000);
}
else{

}

}

so I buyed a Motor with 360 deegrees

It sounds like you have bought a continuous rotation "servo". If so then you cannot control its position using the servo library, only its speed and direction. If you need to control its position then your will need to provide some position feedback to the program.

yes it's an endless, how i can do it with the position feedback?

how i can do it with the position feedback?

That depends on what is providing the feedback.

means? sorry I don't understand this

Rusconichess: means? sorry I don't understand this

If you don't know where the servo shaft is, you can't stop it at a particular place. That isn't too hard to understand, is it?

To know where the shaft is, you must have some mechanism added to the servo that provides that information (referred to as feedback). That's no so hard to understand, it is?

Stopping the motor at a specific point then depends on what that mechanism is that you have attached to the motor (I will NOT call it a servo, since it is not a servo).

So, what mechanism are you attaching to the motor?