hi, well i'm kind of new to the arduino world
so i did some reading and i found that when you write(90); it should stop turning
i'm also using a pot meter to controle it's speed
well mine doesn't, it just jidders in either direction
this my code
#include <Servo.h>
Servo Servo1;
int potpin1 = 0;
int val1;
int poservo1;
int servopin = 6;
so i did some reading and i found that when you write(90); it should stop turning
Where did you read that? The correct advice is to write a value around 90. It may need to be 89 or 91 (or 85 or 95). Whatever it actually takes to drop the speed to 0, which you need to experimentally determine.
Below is some servo test code which can use deg or us command values, that might be of use. Continuous rotation servos which still have pot adjustments can be sent the 1500us command, then the pot carefully adjusted until the motor stops. Then a tiny drop of removable glue like hot glue can be used to secure the shaft position in place.
// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.
String readString;
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
Serial.begin(9600);
myservo.writeMicroseconds(1500); //set initial servo position if desired
myservo.attach(7, 500, 2500); //the pin for the servo control, and range if desired
Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}
void loop() {
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
delay(2); //slow looping to allow buffer to fill with next character
}
if (readString.length() >0) {
Serial.println(readString); //so you can see the captured string
int n = readString.toInt(); //convert readString into a number
// auto select appropriate value, copied from someone elses code.
if(n >= 500)
{
Serial.print("writing Microseconds: ");
Serial.println(n);
myservo.writeMicroseconds(n);
}
else
{
Serial.print("writing Angle: ");
Serial.println(n);
myservo.write(n);
}
readString=""; //empty for next input
}
}