simple rotation cw and ccw with adafruit 16 servo controller

hi all,

i want to just simply turn on a servo so it rotates in both directions for some reason its unstable and i know for sure my sketch is a mess. Could someone help me with correcting it ?

basicly all i want to do is to learn how the servos work. what minumum functions i need to just turn it at full speed all the time in both directions for each servo. Also i cant get a grip what exactly pwm.setpwm does as the last value goes weird.

thx in advance ian

board:

servo:
https://www.kiwi-electronics.nl/digital-continuous-rotation-360-degrees-servo?search=servo


#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
void setup() {
 
 Serial.begin(9600);
 pwm1.begin();
 pwm1.setPWMFreq(60);
}

void loop() {
    pwm1.setPWM(0,0,300);
    pwm1.setPWM(1,0,300);
}

If you just want to learn how a servo works, ditch the driver board for now, connect the servo signal wire to a digital output, connect the servo ground to Arduino ground and the servo power to an external power supply capable of supplying the required servo current (1 amp should do it) and connect the power supply ground to Arduino ground. Then load an example from the Servo library (sweep is one example). After running and playing with the examples you will know more how the servo works and can move to a more complicated setup.

Do not try to power the servo with the Arduino 5V. It might work with the Arduino 5V if the servo is unloaded. but maybe not.

Post a link to the driver board, if you want help with that, so we don't have to hunt it down an guess that we have the right one.

Go read the post at the top of this forum named ‘How to use this forum - please read.’
Number 7 says to use code tags. You did not. But don’t worry, you can go back and edit your post to use code tags.
Number 11 describes tips for getting the most out of your post. It mentions things like
-give the exact part number and preferably a link to the data sheet.
You do not mention which servo board or which servos you are using.

iejun:
what minumum functions i need to just turn it at full speed all the time

Are these continuous rotation servos?

ok sorry ...changed the items

groundfungus:
If you just want to learn how a servo works, ditch the driver board for now, connect the servo signal wire to a digital output, connect the servo ground to Arduino ground and the servo power to an external power supply capable of supplying the required servo current (1 amp should do it) and connect the power supply ground to Arduino ground. Then load an example from the Servo library (sweep is one example). After running and playing with the examples you will know more how the servo works and can move to a more complicated setup.

Do not try to power the servo with the Arduino 5V. It might work with the Arduino 5V if the servo is unloaded. but maybe not.

Post a link to the driver board, if you want help with that, so we don't have to hunt it down an guess that we have the right one.

yeah i did that and played around with a fixed 180degree servo ...but 360degree and the functions of the board places me in a confused position

iejun:
yeah i did that and played around with a fixed 180degree servo …but 360degree

What exactly do you mean by 360 degree?

Post a link to the datasheet for the exact servo you are using.

If you mean a continuous rotation servo then it is very different from a regular servo. In fact it’s just DC motor with speed control in a servo-sized package. You can control its speed and direction with the Arduino, but not its position.

…R