int ldr = A2;    
int AD;
float L;

void setup() {
  Serial.begin(9600);
}

void loop() {
  // measure and calculate
  AD = analogRead(ldr); 
  L = 10230.0 / AD;
  L = L - 10;
  L = 3640 / L;
  // display
  Serial.write(27); 
  Serial.print("[4;5H"); 
  Serial.print("Light intensity "); 
  Serial.print(L); 
  Serial.print(" lux   ");    
  delay(500);                  
}
