Basic dog feeder

hi guys please help me. i am new to the arduino environment and i am struggling with operating the 360 degrees servo motor.

i have a Arduino/Genuino Uno.

//Here is the programming but i am basically trying to make the motor rotate to 0 degrees wait 1 second //then rotate to 180 degrees wait a second and then back to 0 degrees to collect the dog food.
//start//
#include <Servo.h>
using namespace std;
Servo myservo;
void setup()
{
myservo.attach(9);
}

void loop()
{
myservo.write(0);
delay (1000); //the motor jsut keeps spining arround in one direction//
myservo.write(180);
delay(1000);
}

i am struggling with operating the 360 degrees servo motor.

If it is a continuous rotation (not really a) servo then you cannot make it stop at a particular angle unless you get feedback of its position because the value written to it sets the speed and direction of rotation rather than the angle.

A big clue is

//the motor jsut keeps spining arround in one direction//

Can you please clarify the type of servo that you are using.

On a continuous rotation servo, this will set the speed of the servo (with 0 being full-speed in one direction, 180 being full speed in the other, and a value near 90 being no movement).