void setup(){ myservo1.attach(9); // attaches the servo on pin 9 to the servo object myservo2.attach(10); // attaches the servo on pin 10 to the servo object

myservo3.attach(5); // attaches the servo on pin 5 to the servo object myservo4.attach(6); // attaches the servo on pin 6 to the servo object}

void loop(){ val = analogRead(potpin1); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 179, 0); // scale it to use it with the servo (value between 0 and 180) myservo1.write(val); // sets the servo position according to the scaled value val = analogRead(potpin2); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo2.write(val);

val = analogRead(potpin3); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo3.write(val);

val = analogRead(potpin4); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 179, 0); // scale it to use it with the servo (value between 0 and 180) myservo4.write(val); // sets the servo position according to the scaled value // sets the servo position according to the scaled value delay(15); // waits for the servo to get there}

Thats the code i em using, the turbble is that pin 5 and 6 are not sending pwm signals or any signal for that mater (aslo used LED light to test this) every thing else works. 9 and 10 are running 2 of the servos just fine. all 4 inputs are tested and good. Please help me i have been stuck on this for some time now.

I have 4 analog inputs (potentiometer) gong in (0,1,2,3,) and 4 servo. I really don't understand this code it says i can run up to 12 servos with it. I uploaded it to the board as is and go one of the servos to turn one way, so i know im doing something wrong. Im new at this and have a very hard time with code. I still don't under stand why i cant controll more then 2 servos with the pwm pins. I have make lots of led lights fade in and out.

I cam move my wires around to fit any code that being said dose any one have code that will make this work?

Just out of curisoity... did you mean to intentionaly reverse the range of numbers for myservo1 (pin 9) and myservo4 (pin 6) using the map func? What happens if you set all the servo's to the same range's by saying

val = analogRead(potpin1); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo1.write(val); // sets the servo position according to the scaled value val = analogRead(potpin2); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo2.write(val);

val = analogRead(potpin3); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo3.write(val);

val = analogRead(potpin4); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo4.write(val); // sets the servo position according to the scaled value

Maybe that may help? Dunno but may yield diff results at least.

And I dont know if it matters but if indeed you do want the values of myservo1 and myservo4 reversed you may try doing this and seeing if it yields different results:

the numbers have been moved around to get the servos facing the right way. (4in) when i would turn the knob left the servo would go right. so switching the numbers around made the servo turn with the knob.

Ok man, I was a little pissed off at the Mega Servo library at first, but later on I figured out that it was just like the normal library. The library says that it can control 12 servos on one pin (if I understood it correctly, this is what I have been thinking for a while now, so please correct me if I am wrong). Since you dont need that many servos, you can simple do a little switchover from normal library to mega library to allow servos on all pins (a little confusing, but here is some code to help)

untested, but if memory serves me right, this will work and should get you started... the servos are connected to pins 8, 9, 10, 11... potentiometers are Analog 0 - 3

had to mod the code a bit but now all of them are working but there is a glitch. the analog in for 2 is running 2 servos at once. is like its bleeding over so how. my wires are flawless so i really dont know whats going to, i dont see the problem in the code (but then again i mite just not be seeing it) other idea is the arduino mite have some kind of problem. I just cant fig out how the one input is getting split to run 2 different pins going to the servos. Grrrrr :-[im so so close to having this right!!!! when i have this last thing all done i will take some pics and post them so you can see what im doing. and i want to thank you for getting me this far.

"This library allows an Arduino board to control one to twelve RC (hobby) servo motors on any digital pin on a standard Arduino board"

This is the first line in the MegaServo playground page. Perhaps I am misreading, but I think it is saying "12 servos per pin", not "12 servos total, and each can be placed on whatever pin you want". Like i said, correct me if I'm wrong.

This library allows an Arduino board to control one to twelve RC (hobby) servo motors on any digital pin on a standard Arduino board

Means that unlike the standard arduino library that can only use pins 9 and 10, the MegaServo library allows the selection of any pin for a servo. I had assumed it was obvious that each servo needs its own pin, as illustrated in the example sketch.