Any one Can Help with several buttons functions

i’m working on smart home project and i have problem with bottons code can any one help please !!
here is my code :

#include <Servo.h>
#include <Stepper.h>
#define STEPS 100

//room1
const int light1 = 22;
const int fan1 = 23;
Servo win1;
int win1pos = 0;
//room2
const int light2 = 25;
const int fan2 = 26;
Servo win2;
int win2pos = 0;
//entrence
const int lighte1 = 28;
const int lighte2 = 29;
const int fane = 30;
Servo wine;
int winepos = 0;
Servo door;
int doorpos = 0;
/*
Stepper blind(STEPS,44,45,46,47);
int prevblind = 0;
*/

const int PIR = 48;

//ketchen&pathroom
Servo maingaslocker;
int gaspos = 0;
Servo mainwaterlocker;
int waterpos = 0;

//garden
const int lightg = 42;
const int LDRP = A0;
int LDRV = 0;
//bottoms
int bs =0;
const int br1 = 8;
const int br2 = 9;
const int be = 10;
const int bl = 11;
const int bw = 12;
const int bf = 13;

void setup(){
//room1
pinMode(light1, OUTPUT);
pinMode(fan1,OUTPUT);
win1.attach(24);
//room2
pinMode(light2, OUTPUT);
pinMode(fan2,OUTPUT);
win2.attach(27);
//entrence
pinMode(lighte1, OUTPUT);
pinMode(lighte2,OUTPUT);
pinMode(fane,OUTPUT);
wine.attach(41);
door.attach(43);
//garden
pinMode(lightg,OUTPUT);
//ketchen&pathroom
maingaslocker.attach(49);
mainwaterlocker.attach(50);
}
void loop(){
if(digitalRead(br1)==HIGH){
bs = 0;
}
else if (digitalRead(br2)==HIGH){
bs = 1;
}
else if (digitalRead(be)==HIGH){
bs = 2;
}
//
if(bs==0){
if(digitalRead(bl)==HIGH){
digitalWrite(light1,HIGH);
}
else {digitalWrite(light1,LOW);}

if(digitalRead((bw)==HIGH && win1pos < 180 )){
win1.write(win1pos++);
delay(15);}
else if (digitalRead(bw)== HIGH && win1pos > 5){
win1.write(win1pos–);}

if(digitalRead(bf)==HIGH){
digitalWrite(fan1,HIGH);
}
else {digitalWrite(fan1,LOW);}

}
if(bs==1){
if(digitalRead(bl)==HIGH){
digitalWrite(light2,HIGH);
}
else {digitalWrite(light2,LOW);}

if(digitalRead((bw)==HIGH && win2pos < 180 )){
win1.write(win2pos++);
delay(15);}
else if (digitalRead(bw)== HIGH && win2pos > 5){
win1.write(win1pos–);}

if(digitalRead(bf)==HIGH){
digitalWrite(fan2,HIGH);
}
else {digitalWrite(fan2,LOW);}

}

if(bs==2){
if(digitalRead(bl)==HIGH){
digitalWrite(lighte1,HIGH);
}
else {digitalWrite(lighte1,LOW);}

if(digitalRead(bl)==HIGH && digitalRead(bf)==HIGH){
digitalWrite(lighte2,HIGH);}
else {digitalWrite(lighte2,LOW);}

if(digitalRead(bw)==HIGH && winepos < 180 ){
win1.write(winepos++);
delay(15);}
else if (digitalRead(bw)== HIGH && winepos > 5){
win1.write(winepos–);}

if(digitalRead(bf)==HIGH){
digitalWrite(fane,HIGH);
}
else {digitalWrite(fane,LOW);}

if(digitalRead(bl)==HIGH && digitalRead(bw)==HIGH && doorpos < 180 )
{ door.write(doorpos++);
delay(15);}
else if (digitalRead(bl)== HIGH && digitalRead(bw)==HIGH && doorpos > 5 )
{door.write(doorpos–);
delay (15);}
}

//garden
LDRV = analogRead(LDRP);
if(LDRV < 600)
digitalWrite(lightg,HIGH);
else digitalWrite(lightg,LOW);
delay(500);

}

What is the problem you are having with this code? What do you want the code to do? How does that compare with what it actually does?

Please read this: How to Use This Forum and pay particular attention to point 7 about code tags. It makes the code easier to read and easier to copy out of the post for us to work with. You can go back and edit this post and add them now.

The most common problems with buttons are floating pins and bouncing.

Floating pins happens if a pull up or down resistor isn't used or better yet use INPUT_PULLUP to turn on the built in pull up resistor. Using a pull up reverses the logic (LOW = button pressed) .

Bouncing happens with all buttons/switches sometimes it causes problems but not always. In both cases They can cause false positives that can be the source of many problems.

This link explains it all pretty well. gammon switches

For readability, put { } on a line by themselves. Use, CTRL T to format your code. Add comments to your lines of code. .