Pin 12 and 8 won't work properly

I am having issue with my program.
I am working on a 3 floor elevator but right now I am debugging only the 1st floor routine and the elevator stop routine so I removed those parts.
[int Button1;
int Button2;
int Button3;
int Switch1;
int Switch2;
int Switch3;
int Led1=8;
int Led2=9;
int Led3=10;
int L2=11;
int L1=12;
int St=13;
int FLOOR;
int Busy;
int Speed;

void setup() {
pinMode(2, INPUT); // Button 1st floor
pinMode(3, INPUT); // Button 2nd floor
pinMode(4, INPUT); // Button 3rd floor
pinMode(5, INPUT); // position swith Elevator 1st floor
pinMode(6, INPUT); // position swith Elevator 2nd floor
pinMode(7, INPUT); // position swith Elevator 3rd floor
pinMode(8, OUTPUT); // led 1st floor
pinMode(9, OUTPUT); // led 2nd floor
pinMode(10, OUTPUT); // led 3rd floor
pinMode(11, OUTPUT); // Power switches
pinMode(12, OUTPUT); // Power motor exit 1
pinMode(13, OUTPUT); // Power motor exit 2
Busy = 0; // internal variable define if the elevator is workind and unable push buttons
FLOOR = 0;// internal variable determine on which floor the elevator is going
Speed= analogRead(0) / 4;
digitalWrite(St, LOW);
digitalWrite(Led1, LOW);
}
void loop() { //Define variables
Variables();
First_floor();
El_stop();
}

void Variables() { //Define variables
Button1 = digitalRead(2);
Button2 = digitalRead(3);
Button3 = digitalRead(4);
Switch1 = digitalRead(5);
Switch2 = digitalRead(6);
Switch3 = digitalRead(7);
}

void First_floor() { //1ST FLOOR
if (Busy = 0);
if (Button1 == HIGH)
{
digitalWrite(St, HIGH);
}
if ((Switch1 == LOW) and (Button1==HIGH))
{ digitalWrite(Led1, HIGH);
digitalWrite(L1, HIGH);
digitalWrite(L2, LOW);
Busy = 1;
FLOOR = 1;
}
}

void El_stop () { //El_stop
Serial.print(L1);
if (Busy = 1);
if ((FLOOR == 1) and (Switch1 == HIGH))
{ digitalWrite(St, LOW);
digitalWrite(L1, LOW);
digitalWrite(L2, LOW);
digitalWrite(Led1, LOW);
Busy = 0;
FLOOR = 0;
}
else if ((FLOOR == 2) and (Switch2 == HIGH))
{ digitalWrite(St, LOW);
digitalWrite(L1, LOW);
digitalWrite(L2, LOW);
Busy = 0;
FLOOR = 0;
}
else if ((FLOOR == 3) and (Switch3 == HIGH))
{ digitalWrite(St, LOW);
digitalWrite(L1, LOW);
digitalWrite(L2, LOW);
Busy = 0;
FLOOR = 0;
}
}]

In particular I am having issue with this part
[ if ((Switch1 == LOW) and (Button1==HIGH))
{ digitalWrite(Led1, HIGH);
digitalWrite(L1, HIGH);
digitalWrite(L2, LOW);
Busy = 1;
FLOOR = 1;]

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please provide details of what you mean by "I am having issue with my program".

Try printing the values before you test them. Are they what you expect ? How are the inputs wired ?

@Claudioit nearly got it right :wink:

@Claudioit, please replace the

[ at the beginning of your code by 
[code] and the ] at the end of your code by [/code]
.

Next explain the use of the buttons, switches and leds. The names might make sense to you but not necessarily to us.

And and if statement terminated by a semi-colon does do nothing. E.g.

 if (Busy = 1);

And there is a difference between '=' and '=='.

Hi,
Can I suggest you use descriptive names for your pins so it will help with reading your code'
For example;

int Button1;
int Button2;
int Button3;
int Switch1;
int Switch2;
int Switch3;
int Button1Pin = 2;
int Button2Pin = 3;
int Button3Pin = 4;
int ElevPos1Pin = 5;
int ElevPos2Pin = 6;
int ElevPos3Pin = 7;
int Led1Pin = 8;
int Led2Pin = 9;
int Led3Pin = 10;
int L2Pin = 11;
int L1Pin = 12;
int StPin = 13;
int FLOOR;
int Busy;
int Speed;

void setup() {
  pinMode(Button1Pin, INPUT); // Button 1st floor
  pinMode(Button2Pin, INPUT); // Button 2nd floor
  pinMode(Button3Pin, INPUT); // Button 3rd floor
  pinMode(ElevPos1Pin, INPUT); // position swith Elevator 1st floor
  pinMode(ElevPos2Pin, INPUT); // position swith Elevator 2nd floor
  pinMode(ElevPos3Pin, INPUT); // position swith Elevator 3rd floor
  pinMode(Led1Pin, OUTPUT);   // led 1st floor
  pinMode(Led2Pin, OUTPUT);   // led 2nd floor
  pinMode(Led3Pin, OUTPUT);   // led 3rd floor
  pinMode(L2Pin, OUTPUT);     // Power switches
  pinMode(L1Pin, OUTPUT);     // Power motor exit 1
  pinMode(StPin, OUTPUT);     // Power motor exit 2

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Thanks.. Tom.. :slight_smile:

Isn't this the same project?
https://forum.arduino.cc/index.php?topic=530692.msg3617441#msg3617441