Skip to main content
added 4 characters in body
Source Link
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

I useduse a 360° servo with a program I made on an Arduino Uno.

The program was meant to control two separate servos with two potentiometers on a breadboard. 

When I used 180° and 90° servos, it worked fine, but when the 180° servo was swapped with a 360° servo, it kept spinning and spinning non-stop.

Could it be the knock-off board (not Arduino brand) I'm using?

Servo serX;    // create servo object to control a servo for x axis
Servo serY;    // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1;  // potentiometer number 2
int val;       // variable to read the value from the analog pin
int val2;      // read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); // attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);           // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);  // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);          // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90); // scale it to use it with the servo
  serY.write(val2);                 // sets the servo position
  
  delay(15);                        // waits for the servo to get there
}

I used a 360° servo with a program I made on an Arduino Uno.

The program was meant to control two separate servos with two potentiometers on a breadboard. When I used 180° and 90° servos, it worked fine, but when the 180° servo was swapped with a 360° servo, it kept spinning and spinning non-stop.

Could it be the knock-off board (not Arduino brand) I'm using?

Servo serX;    // create servo object to control a servo for x axis
Servo serY;    // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1;  // potentiometer number 2
int val;       // variable to read the value from the analog pin
int val2;      // read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); // attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);           // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);  // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);          // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90); // scale it to use it with the servo
  serY.write(val2);                 // sets the servo position
  
  delay(15);                        // waits for the servo to get there
}

I use a 360° servo with a program I made on an Arduino Uno.

The program was meant to control two separate servos with two potentiometers on a breadboard. 

When I used 180° and 90° servos, it worked fine, but when the 180° servo was swapped with a 360° servo, it kept spinning and spinning non-stop.

Could it be the knock-off board (not Arduino brand) I'm using?

Servo serX;    // create servo object to control a servo for x axis
Servo serY;    // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1;  // potentiometer number 2
int val;       // variable to read the value from the analog pin
int val2;      // read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); // attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);           // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);  // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);          // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90); // scale it to use it with the servo
  serY.write(val2);                 // sets the servo position
  
  delay(15);                        // waits for the servo to get there
}
added 8 characters in body; edited title
Source Link
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

servo Servo keeps rotating

so i pluggedI used a 360 degree360° servo intowith a program iI made on an arduino unoArduino Uno. the

The program was meant to control two separate servos with two potentiometers on a breadboard. when iWhen I used 180180° and 90 degree90° servos, it worked fine, but when the 180 degree180° servo was swapped with a 360 degree360° servo, it kept spinning and spinning nonstopnon-stop. could

Could it be the knockoffknock-off board (not arduinoArduino brand) imI'm using?

Servo serX;  // create servo object to control a servo for x axis
Servo serY; // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1; //potentiometer number 2
int val;    // variable to read the value from the analog pin
int val2; //read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); //attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);            // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);            // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90);     // scale it to use it with the servo
  serY.write(val2);                  // sets the servo position
  
  delay(15);                           // waits for the servo to get there
}
Servo serX;    // create servo object to control a servo for x axis
Servo serY;    // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1;  // potentiometer number 2
int val;       // variable to read the value from the analog pin
int val2;      // read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); // attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);           // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);  // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);          // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90); // scale it to use it with the servo
  serY.write(val2);                 // sets the servo position
  
  delay(15);                        // waits for the servo to get there
}

servo keeps rotating

so i plugged a 360 degree servo into a program i made on an arduino uno. the program was meant to control two separate servos with two potentiometers on a breadboard. when i used 180 and 90 degree servos, it worked fine, but when the 180 degree servo was swapped with a 360 degree servo, it kept spinning and spinning nonstop. could it be the knockoff board (not arduino brand) im using?

Servo serX;  // create servo object to control a servo for x axis
Servo serY; // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1; //potentiometer number 2
int val;    // variable to read the value from the analog pin
int val2; //read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); //attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);            // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);            // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90);     // scale it to use it with the servo
  serY.write(val2);                  // sets the servo position
  
  delay(15);                           // waits for the servo to get there
}

Servo keeps rotating

I used a 360° servo with a program I made on an Arduino Uno.

The program was meant to control two separate servos with two potentiometers on a breadboard. When I used 180° and 90° servos, it worked fine, but when the 180° servo was swapped with a 360° servo, it kept spinning and spinning non-stop.

Could it be the knock-off board (not Arduino brand) I'm using?

Servo serX;    // create servo object to control a servo for x axis
Servo serY;    // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1;  // potentiometer number 2
int val;       // variable to read the value from the analog pin
int val2;      // read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); // attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);           // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);  // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);          // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90); // scale it to use it with the servo
  serY.write(val2);                 // sets the servo position
  
  delay(15);                        // waits for the servo to get there
}
Source Link

servo keeps rotating

so i plugged a 360 degree servo into a program i made on an arduino uno. the program was meant to control two separate servos with two potentiometers on a breadboard. when i used 180 and 90 degree servos, it worked fine, but when the 180 degree servo was swapped with a 360 degree servo, it kept spinning and spinning nonstop. could it be the knockoff board (not arduino brand) im using?

Servo serX;  // create servo object to control a servo for x axis
Servo serY; // create servo y axis

int pot1 = 0;  // potentiometer pin number on board
int pot2 = 1; //potentiometer number 2
int val;    // variable to read the value from the analog pin
int val2; //read value from other analog pin

void setup() {
  serX.attach(9);  // attaches the servo on pin 9 to the servo object
  serY.attach(10); //attach servo to number 10 pin
}

void loop() {
  val = analogRead(pot1);            // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo
  serX.write(val);                  // sets the servo position
  
  val2 = analogRead(pot2);            // reads the value of the potentiometer
  val2 = map(val2, 0, 1023, 0, 90);     // scale it to use it with the servo
  serY.write(val2);                  // sets the servo position
  
  delay(15);                           // waits for the servo to get there
}