Trying to figure out why a simplest of commands isnt working

I have never before used Arduino IDE, or C++, however i decided that it would be fun to try and build a hexopod, i made a leg to test out if the servo's i have, can even lift the leg with them inside, and i am now on the coding stage, also im using adafruit to controll multiple servo's in the future, my code is as follows:

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
#define SERVOMIN  150 
#define SERVOMAX  600 
uint8_t servo = 0;

void setup() {
  Serial.begin(9600);
  pwm.begin();
  pwm.setPWMFreq(50);
}

void loop() {
  pwm.setPWM(servo, 0, 600);
  delay(500);
  Serial.println("Mid-loop");
  pwm.setPWM(servo, 0, 150);
  delay(500);
  Serial.println("End of the loop");
}

from my uderstanding the servo should just rotate on loop for ever, but the servo is just simply not moving, i have checked countless times if its a wiring problem, but the "servo" example code is working just fine so clearly thats not it, however, the Serial.print() does print out what part of the loop is supposed to happen. Am i not understanding how this works or am i stupid? please help.

Welcome to the forum

As your topic does not relate directly to the installation or operation of the IDE it has been moved to the Programming Questions category of the forum

You are sending pulse widths of 150µs and 600µs to your servo.
Are those pulses within the range of pulse widths that your servo requires?

A lot of servos require pulses between 1ms (1000µs) and 2ms (2000µs).

Which servo driver are you using?
I use this:

oh im actually not sure, ty for the tip, ill try to change my code accordingly real quick

i also use this one

well here is the problem, the servo DID move, however it only moved once. So is the loop not working?

Did you try the example for this board?
IDE -> File -> Examples -> Adafruit PWM Servo Driver -> servo

yes, the example worked just fine

The example sets the frequency. Don't know if that helps.

void setup() {
  Serial.begin(9600);
  pwm.begin();

// Example has this.
 pwm.setOscillatorFrequency(27000000);

  pwm.setPWMFreq(50);
}

Be specific.

The PWM example starts with this...

  pwm.setOscillatorFrequency(27000000);
  pwm.setPWMFreq(1600);

i tried setting up the frequency before but it changed literally nothing so i got rid of it.

The example worked so you got rid of it?

no i didnt get rid of the example i got rid of the setOscillatorFrequency() inside of my script

That function call is required for PWM and Servo modes.
I would put it back in.

Use the working example to make your devices do what you want... edit the example as you need.

well i mostly am just trying to figure out what i did wrong, cause even if i use the examples it could potentially come back to bite me in the future, it being my lack of knowledge in this situation.

Where are the servos getting their power? Batteries to the Adafruit servo driver board?

i hooked the power up to a power bank for now.

Try this. According to the example, your value must be greater than SERVO_MIN and less than SERVO_MAX.

void loop() {
  pwm.setPWM(servo, 0, 599);
  delay(500);
  Serial.println("Mid-loop");
  pwm.setPWM(servo, 0, 151);
  delay(500);
  Serial.println("End of the loop");
}