I trying to use this servo to turn it continuously but i can't.
I try to googling and found that if I use Servo.h libraly with continuous Servos I got this results
I use this command . myservo.write(180) ,myservo.write(0), myservo.write(90) its must turn in counterclockwise, clockwise directions continuously and but my result is its only turn 0-180 deg.
I'm I miss understanded , any solution for this problems
p.s i'm thai so "Khob koon Krab" for any helping and sorry for my bad enlish I hope you guys can understand me thank you.
but my result is its only turn 0-180 deg.
Since you seem to have only told it to go to positions 0, 90, and 180, that is hardly surprising.
Where IS your code?
I try this simple code
#include<Servo.h>
Servo myservo;
void setup() {
myservo.attach(9)
}
void loop() {
myservo.write(180);
delay(10000);
myservo.write(0);
delay(10000);
myservo.write(90);
delay(5000);
}
and I also try this too.
float pos = 0;
void setup() {
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop() {
int a = 0;
float pos2 = 20 - pos;
while (a <= 100) {
digitalWrite(9, HIGH);
delay(pos);
digitalWrite(9, LOW);
delay(pos2);
Serial.print(pos);
Serial.print(" /// ");
Serial.println(pos2);
a++;
}
pos += 0.1;
}
because I googling and found that servo controlled by pulse signal of 20 ms if it's have any value that I can turn it continuously in every direction I should know right? Sorry if its not correct and stupid method.
This is your simple code in code tags
#include<Servo.h>
Servo myservo;
void setup()
{
myservo.attach(9)
}
void loop()
{
myservo.write(180);
delay(10000);
myservo.write(0);
delay(10000);
myservo.write(90);
delay(5000);
}
What happens when you run it ?
Which pins is the servo connected to ?
What is powering the servo ?
And, what happens when you add
myservo.write(270);
delay(5000);
myservo.write(350);
delay(5000);
to it?