Doorlock.. Proplem with the servo motor

Hi guys....
Iam trying to make a password door lock using arduino and sevo motor and keypad and the lock.... So every thing is working fine but i need to increase the movement of the servo motor when i write the password..... Because when the servo motor move it only push the lock centimetres away so how can i increase the angle and movement of the servo motor
Here is the code


#include <Keypad.h>
#include <LiquidCrystal.h>
#include <Servo.h>

#define Password_Length 5

Servo myservo;
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);

int pos = 0;

char Data[Password_Length];
char Master[Password_Length] = "1234";
byte data_count = 0, master_count = 0;

bool Pass_is_good;
bool door = false;
char customKey;


/*---preparing keypad---*/

const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};


byte rowPins[ROWS] = {0, 1, 2, 3};
byte colPins[COLS] = {4, 5, 6, 7};

Keypad customKeypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);


/*--- Main Action ---*/
void setup()
{
  myservo.attach(9, 2000, 2400);
  ServoClose();
  lcd.begin(16, 2);
  lcd.print("Protected Door");
  loading("Loading");
  lcd.clear();
}


void loop()
{
  if (door == true)
  {
    customKey = customKeypad.getKey();
    if (customKey == '#')
    {
      lcd.clear();
      ServoClose();
      lcd.print("Door is closed");
      delay(3000);
      door = false;
    }
  }
  else
    Open();

}

void loading (char msg[]) {
  lcd.setCursor(0, 1);
  lcd.print(msg);

  for (int i = 0; i < 9; i++) {
    delay(1000);
    lcd.print(".");
  }
}

void clearData()
{
  while (data_count != 0)
  { 
    Data[data_count--] = 0;
  }
  return;
}

void ServoClose()
{
  for (pos = 90; pos >= 0; pos -= 10) { 
    myservo.write(pos);
  }
}

void ServoOpen()
{
  for (pos = 0; pos <= 90; pos += 10) {
    myservo.write(pos);  
  }
}

void Open()
{
  lcd.setCursor(0, 0);
  lcd.print("Enter Password");
  
  customKey = customKeypad.getKey();
  if (customKey)
  {
    Data[data_count] = customKey;
    lcd.setCursor(data_count, 1);
    lcd.print(Data[data_count]);
    data_count++;
  }

  if (data_count == Password_Length - 1)
  {
    if (!strcmp(Data, Master))
    {
      lcd.clear();
      ServoOpen();
      lcd.print(" Door is Open ");
      door = true;
      delay(5000);
      loading("Waiting");
      lcd.clear();
      lcd.print(" Time is up! ");
      delay(1000);
      ServoClose();
      door = false;      
    }
    else
    {
      lcd.clear();
      lcd.print(" Wrong Password ");
      door = false;
    }
    delay(1000);
    lcd.clear();
    clearData();
  }
}

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
code tags new

What is the angle you are currently programming? What is the maximum the servo can move? You increase the lock movement by lengthening the servo arm.

I fixed the code

For more explanation..... The lock doesnt move enough to be opened and that is because the servo motor rotate little rotation.... So my question is how can i make it rotate more

You could increase the length of the servo arm

That (2000, 2400) limits the servo range of motion. Try it with just:
myservo.attach(9);

Still the same movement

But if i done this it will rotate without stopping right?

Not if it is a real servo.

A real hobby servo will have a range of motion of about 0 to 180 degrees (1000 to 2000 microseconds). If the servo runs without stopping that is usually a "continuous" servo and is not really a servo, just a gear motor whose speed and direction are controlled by a servo type signal.


Is this one a real one?

Even if it is a real one i dont want to make it rotate 180 degree i only want to increase it movement to 90 degree maximum or less

Ok i want to make a limit but more than what itis

Can't tell by looking. A continuous servo has had its internal feedback element (potentiometer) disconnected.

Ok we are in a good position now...... I need to make it a range but not this range.... I need a range that make it rotate 90 degrees maximum

Those functions position the servo. Change the numbers in the write function to what you want as the open and closed limits.

And you need a bit of delay in the for loop to give the servo time to move. See the examples that come with the servo library.

This is the part i want to change

But i dont understand this numbers so i can't change it.... If you understand it and can help?

What is not to understand?

servo.attach(pin, min, max)