Controlling an Arduino using Buttons

Hi there, I am designing an underwater scooter and I have everything except the code to control the ESCs.I want to do this through push buttons. So far I have this, I want to have the output for the ESCs pin 6 (digital pwm) and the input analog pin 2,3,4,5. The code so far has not put an error messages, however it does not work at all, the motors just did what they wanted and it did not do anything when I connected the pins to ground or to 5 volts.Can anyone help?

#include <Servo.h>

Servo m1;

int pushButton = 2;
int pushButton1 = 3;
int pushButton2 = 4;
int pushButton3 = 5;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
m1.attach(6);
delay(1);
m1.writeMicroseconds(1000);
pinMode(pushButton, INPUT);
}

void loop() {

if (digitalRead(pushButton) == HIGH > LOW) { //Opens the door when the ‘open’ button is pressed
m1.attach(6); //Gives the servo power
m1.writeMicroseconds(1500); //Tells servo to move to 0 degree mark
delay(1); // waits 1000ms for the servo to reach the position
} else {
m1.writeMicroseconds(1000);
delay(1);

}

{
if (digitalRead(pushButton1) == HIGH > LOW) { //Opens the door when the ‘open’ button is pressed
m1.attach(6); //Gives the servo power
m1.writeMicroseconds(1600); //Tells servo to move to 0 degree mark
delay(1); // waits 1000ms for the servo to reach the position
}

{
if (digitalRead(pushButton2) == HIGH > LOW) { //Opens the door when the ‘open’ button is pressed
m1.attach(6); //Gives the servo power
m1.writeMicroseconds(1800); //Tells servo to move to 0 degree mark
delay(1); // waits 1000ms for the servo to reach the position
}

{
if (digitalRead(pushButton3) == HIGH > LOW) { //Opens the door when the ‘open’ button is pressed
m1.attach(6); //Gives the servo power
m1.writeMicroseconds(1800); //Tells servo to move to 0 degree mark
delay(1); // waits 1000ms for the servo to reach the position
}

}
}
}
[/b] }

  if (digitalRead(pushButton2) == HIGH > LOW) What's that?

Why don't you attach the servo once, in setup?

Please remember to use code tags when posting code

Matyk:
and the input analog pin 2,3,4,5.

int pushButton = 2;

int pushButton1 = 3;
int pushButton2 = 4;
int pushButton3 = 5;

if (digitalRead(pushButton) == HIGH > LOW) { //Opens the door when the 'open' button is pressed
 if (digitalRead(pushButton1) == HIGH > LOW) { //Opens the door when the 'open' button is pressed
 if (digitalRead(pushButton2) == HIGH > LOW) { //Opens the door when the 'open' button is pressed
 if (digitalRead(pushButton3) == HIGH > LOW) { //Opens the door when the 'open' button is pressed

You are NOT using the analog input pins for input. You are using DIGITAL pins 2, 3, 4, and 5. To use the analog input pins, change the pin numbers to:

int pushButton = A2;
int pushButton1 = A3;
int pushButton2 = A4;
int pushButton3 = A5;