Railwaycrossing

 LDRValue = analogRead(LDR);      //reads the ldr¹s value through LDR
  
 LDRValue2 = analogRead(LDR);      //reads the second ldr¹s value throughLDR

This code is not as you intend, I think. The second value should be LDR2?