Please help my project ( Pick to Light )

Hello everyone

Actually, I not a programmer and very new for Arduino.
I have project about Pick to Light system for my warehouse.
I wrote my sketch logic as :

  1. serial monitor send "1" => ledPin1 = HIGH ( it work )
  2. read switchPin1 = HIGH => ledPin1 = LOW ( it work )

my problem on next step

  1. if LedPin1 = HIGH and other switchPin ( not switchPin1) = HIGH
    I would like order to ledPin3 = HIGH.

Could you please help me what wrong and how to do.
Thank you very much in advance.

enclosed : my sketch

int ledPin = 13;
int ledPin1 =22;
int ledPin2 =23;
int ledPin3 =24;
int AllLedPin[]={ledPin1,ledPin2,ledPin3};

int switchPin1 = 2;
int switchPin2 = 3;
int value = 0;

int buzzer1=8;

void setup() {
pinMode(ledPin1,OUTPUT);
pinMode(ledPin2,OUTPUT);
pinMode(ledPin3,OUTPUT);
pinMode(switchPin1, INPUT);
pinMode(switchPin2, INPUT);
pinMode(buzzer1,OUTPUT);

Serial.begin(9600);
}

void loop() {

if(Serial.available()>0){
int inByte=Serial.read();

switch (inByte){

case '1':
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,LOW);
digitalWrite(ledPin1,HIGH);
break;

case '2':
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,LOW);
digitalWrite(ledPin2,HIGH);
break;

}

}

value = digitalRead(switchPin1);// read sensor
if (value == 0 ) {
digitalWrite(ledPin1,LOW); // turn off led if sensor read
}

value = digitalRead(switchPin2);// read sensor
if (value == 0) {
digitalWrite(ledPin2,LOW);// turn off led if sensor read
}

}

if((digitalRead(LedPin1)==HIGH) && (digitalRead(switchPin2)==HIGH))
{
//Do somthing here
} else {
// Do something else here
}
  1. if LedPin1 = HIGH and other switchPin ( not switchPin1) = HIGH
    I would like order to ledPin3 = HIGH.

You do not have any code in your program to read the state of LedPin1. Which part of the requirement are you stuck on ?

It would help considerably if you put your code in code tags. Modify your post, select the code and click on the icon far left above the editor window and save the post again.

UKHeliBob:
You do not have any code in your program to read the state of LedPin1. Which part of the requirement are you stuck on ?

But you can read the state of a digital output with the digitalRead()... Perhaps not the best way, but possible (and easy to do)

you can read the state of a digital output with the digitalRead().

That's exactly what I had in mind but he is not doing it.
My comment was to the OP.

Hello
Already work
Thank you very much.

if((digitalRead(ledPin1)==HIGH) && (digitalRead(switchPin2)==0)){
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin3,HIGH);

}

if((digitalRead(ledPin2)==HIGH) && (digitalRead(switchPin1)==0)){
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,HIGH);

}

int AllLedPin[]={ledPin1,ledPin2,ledPin3};

Three out of four is NOT all.