So, this question might sound a bit silly but since I am new to arduino and robotics I would like to know how to connect multiple servos to my arduino?
I bought a torobot servo controller because I thought that I can connect it to my arduino easily but I don't know how to connect it to my arduino. I didn't find any real helpful answers in the internet. Do I have to solder it together? And if I did that, what about programming? Do I have to program it in the arduino IDE or in the torobot IDE if I connected both of them? Again, I am sorry to ask such questions that might sound stupid to the professional arduino makers of you out there but please help me instead of making fun of me.
-skullmonkee
Skullmonkee,
I think being new you may stick with the software that torobot provides. as for the hook up remember red is + and Black is negative and the orange or white is signal. Your board will show this on the row of pins -+sig or GVS.
You could have also gone a much cheaper route with a $13 arduino and a $5 servo shield.
good luck.
Hi-
That seems like two questions....
-
To connect multiple servos to Arduino (ala your thread title), you don't really need a servo controller. Hook them up as shown in the pic attached. Control them using the standard servo library as in this skecth and this one, just replicating the lines to have servos called (eg) myServoLeft and myServoRight or whatever names you like, then use myServoLeft.pos() etc.
-
Re the torobot controller assembly and programming, sorry but I've no idea. Others may be able to help there.
weldsmith:
a $5 servo shield.
You don't even need that....

Servo code for controlling several servos from the serial monitor.
//zoomkat 11-22-12 simple delimited ',' string parse
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added
// Powering a servo from the arduino usually *DOES NOT WORK*.
String readString;
#include <Servo.h>
Servo myservoa, myservob, myservoc, myservod; // create servo object to control a servo
void setup() {
Serial.begin(9600);
//myservoa.writeMicroseconds(1500); //set initial servo position if desired
myservoa.attach(6); //the pin for the servoa control
myservob.attach(7); //the pin for the servob control
myservoc.attach(8); //the pin for the servoc control
myservod.attach(9); //the pin for the servod control
Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}
void loop() {
//expect single strings like 700a, or 1500c, or 2000d,
//or like 30c, or 90a, or 180d,
//or combined like 30c,180b,70a,120d,
if (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
if (c == ',') {
if (readString.length() >1) {
Serial.println(readString); //prints string to serial port out
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);
if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
}
else
{
Serial.print("writing Angle: ");
Serial.println(n);
if(readString.indexOf('a') >0) myservoa.write(n);
if(readString.indexOf('b') >0) myservob.write(n);
if(readString.indexOf('c') >0) myservoc.write(n);
if(readString.indexOf('d') >0) myservod.write(n);
}
readString=""; //clears variable for new input
}
}
else {
readString += c; //makes the string readString
}
}
}
Thank you all for your replies!
I really appreciate it!
JimboZA:
...To connect multiple servos to Arduino (ala your thread title), you don't really need a servo controller. Hook them up as shown in the pic attached. Control them using the standard servo library as in this skecth and this one, just replicating the lines to have servos called (eg) myServoLeft and myServoRight or whatever names you like, then use myServoLeft.pos() etc.
so, assuming that i want to build something like a robot with multiple servos, do i still have to use a breadbord or is something else better?
You might not even need a breadboard or anything at all, I can't answer that question.