ASSALAMUALIKUM!
I want some help!
in the below given code i want relay 2 to operate when password is enter ,if correct then it wait for to enter another passkey i.e 'A' after this relay 2 will operate,i have used if within if as shown below but this is not working.
if((code[0]=='1') && (code[1]=='2') && (code[2]=='3') && (code[3]=='4')) //Match the password
{
if(customKey=='A') //keypad key
{ digitalWrite(relay2,HIGH)
lcd.setCursor(0,1);
lcd.print("LOAD 2 ON ");
}
digitalWrite(RELAY1,HIGH); //Turn on Relay (Unlocked)
lcd.setCursor(0,1);
lcd.print("LOAD 1 ON ");
}
What a mess of horrible formatting you've dropped on us here. Have some respect for the people you're expecting free help from.
Please always do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.
I don't see the code you posted here anywhere in your attached sketch.
Cut down the project in smaller pieces. Make small sketches that verifies the function of that part. Then do the same for the next part of the project. Using Serial.print telling just "I am here at 1" verifies that step in the sketch.
That has saved me in my carrier during 25 years facing large and unknown code made by other people.