Using HT12D with Arduino to control servos with remote

I would like to have some help with my Arduino project. I’m using Arduino ADK with HT12E encoder and HT12D decoder chips. I would like to make a remote control for 4 servos using a transmitter and receiver. I have a sketch that works with 4 LEDs and it works great just like I need, but when I try to make 1 servo move, the servo go from one set point to the other with no control in-between. I’m sure it has something to do with the servo but not sure what it would be. I’m new to Arduino and having a little problem understanding how it works but I’m enjoy myself trying.

A question like this requires a schematic and code uploaded. You are not going to get any help until you do that.

great, sorry i will have to get that for you.

Servo test code you can use to verify your servo is operating as desired.

// zoomkat 12-25-13 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// Send an a to attach servo or d to detach servo
// for IDE 1.0.5 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include <Servo.h> 
String readString; //String captured from serial port
Servo myservo;  // create servo object to control a servo 
int n; //value to write to 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 all-in-one test code 12-25-13"); // so I can keep track of what is loaded
  Serial.println();
}

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 

      // attach or detach servo if desired
    if (readString == "d") { 
      myservo.detach(); //detach servo
      Serial.println("servo detached");
      goto bailout; //jump over writing to servo
    }
    if (readString == "a") {
      myservo.attach(7); //reattach servo to pin 7
      Serial.println("servo attached");
      goto bailout;
    }    

    n = readString.toInt();  //convert readString into a number

    // auto select appropriate value
    if(n >= 500)
    {
      Serial.print("writing Microseconds: ");
      Serial.println(n);
      myservo.writeMicroseconds(n);
    }
    else
    {   
      Serial.print("writing Angle: ");
      Serial.println(n);
      myservo.write(n); 
    }

bailout: //reenter code loop
    Serial.print("Last servo command position: ");    
    Serial.println(myservo.read());
    Serial.println();
    readString=""; //empty for next input
  }
}

I powered my servos with separate power supply and everything seems to worked as planed. Can anyone explain to me why I can't power my servos from the same power supply as my arduino.

Remember this ?

A question like this requires a schematic and code uploaded. You are not going to get any help until you do that.

nieuport:
I powered my servos with separate power supply and everything seems to worked as planed. Can anyone explain to me why I can't power my servos from the same power supply as my arduino.

If the power supply is small, the servos will draw down the power supply voltage to the point the arduino resets.

I have a sketch that works with 4 LEDs and it works great just like I need, but when I try to make 1 servo move, the servo go from one set point to the other with no control in-between.

That doesn't sound like a reset.