Need help!

I cant see the problem... it doesnt work with arduino. Can you please help me?

#include "SPI.h"  
#include "MFRC522.h"
#include <Password.h>
#include <Keypad.h> 
#include <LiquidCrystal.h>

#define SS_PIN 10  
#define RST_PIN 9  

int vklop;

MFRC522 rfid(SS_PIN, RST_PIN);  

MFRC522::MIFARE_Key key;

LiquidCrystal lcd(A5, A4, 8, 7, 1, 0);  
Password password = Password( "1234" ); 

const byte ROWS = 4; 
const byte COLS = 4; 

char keys[ROWS][COLS] = { 
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};

byte rowPins[ROWS] = { 3,4,5,6 }; 
byte colPins[COLS] = { A0,A1,A2,A3 };

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); >:( 

int state = 0;
int flag = 0;  

void setup() {
 lcd.begin(16, 2); 
 lcd.clear();
 SPI.begin();
 rfid.PCD_Init();  
 pinMode(2, OUTPUT);  
 keypad.addEventListener(keypadEvent);
 
}

void loop() {
 keypad.getKey(); 



 
 if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) 
   return;

 MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak); 

 if (piccType != MFRC522::PICC_TYPE_MIFARE_MINI && 
     piccType != MFRC522::PICC_TYPE_MIFARE_1K &&
     piccType != MFRC522::PICC_TYPE_MIFARE_4K) {
   return;
 }
 String strID = "";
 for (byte i = 0; i < 4; i++) {
   strID +=
     (rfid.uid.uidByte[i] < 0x10 ? "0" : "") +
     String(rfid.uid.uidByte[i], HEX) +
     (i != 3 ? ":" : "");
 }

 strID.toUpperCase();
 delay(1000);

 if (strID.indexOf("02:72:B1:89") >= 0) { 


  if(digitalRead(2) == HIGH) { 
   digitalWrite(2, LOW); 
   lcd.clear(); 
   delay(10);
   lcd.print("ZAPRTO"); 
   delay(1000);
   }
   else if(digitalRead(2) == LOW) { 
     digitalWrite(2, HIGH); 
     lcd.clear(); 
     delay(10);
     lcd.print("ODPRTO"); 
     delay(1000);
   
   }
   
  
   
   }
  
 else { 
 }



if(Serial.available() > 0){ 
state = Serial.read(); 
flag=0; 
}

if (state == '0') {  
digitalWrite(2, LOW); 
   
if(flag == 0){ 
   lcd.clear(); 
   delay(10);
   lcd.print("ZAPRTO"); 
flag = 1; 
}
}

else if (state == '1') { 
digitalWrite(2, HIGH); 

if(flag == 0){ 
   lcd.clear(); 
   delay(10);
   lcd.print("ODPRTO"); 
flag = 1; 
}
} 
}



void keypadEvent(KeypadEvent eKey){ 
 switch (keypad.getState()){
 case PRESSED:
 
 delay(10);

 
 switch (eKey){
   case '#': checkPassword(); delay(1); break; 
   
   case '*': password.reset(); delay(1); break; 

   case 'A': digitalWrite(2, LOW); 
   lcd.clear();
   delay(10);
   lcd.print("ZAPRTO");
   password.reset();
   break;
   
    default: password.append(eKey); delay(1);
}
}
}
void checkPassword(){ 
 
if (password.evaluate()){  
   lcd.clear(); 
   delay(10);
   lcd.print("ODPRTO"); 
   delay(10);
   digitalWrite(2,HIGH);   
}
else{ 
delay(10);
}
}

Is this you again ? ? ? ? ?

Posting the same question twice does not get answers any quicker. In fact it puts people (including me) off providing help.

What is that smiley doing in your code? And those italics?

Edit your post and add

[code] before your code and [/code]

after your code, please.

Now you have the code posted correctly your next step is to tell us what it is supposed to do and what, if anything, it is actually doing. Just saying "doesn't work" isn't very helpful.

Steve

Everything works except lcd...

LiquidCrystal lcd(A5, A4, 8, 7, 1, 0);Using pins 0 and 1 for the LCD is not a good idea because they are used by the hardware serial interface.

I see you two are working on nearly identical code and posted from the same IP address. Which leaves two possibilities: sock-puppet or classmates. I suggest the two of you get organized and work together.

@Lan244, you are not participating in the process so I locked your thread. If the two of you really are working independently use Report to moderator to get your thread unlocked.

@jakobcesar, stop cross-posting. Other thread removed.