I think I've finally sorted and perfected a code for reading a simple LDR and calculating a lux value.
Here's the basic circuit: (sorry about the simpleness)
______________________
5v----10k--v--LDR----GND
________(A5)___________
All self explanatory, the v and (A5) below it is the connection between 10k and LDR to analogue pin 5 on the arduino.
The code is tuned to the circuit you're using, to be as precise as possible, so where it says 10.72 that is the 10k resistor in kOhms that I checked using a mulitmeter. Likewise I double checked the 5v, which was exactly 5v on my voltmeter. The very small long number (0.00488...) is 5/1023, again use the true voltage to get accurate results.
int LDR = 5; // select the input pin for the LDR
void setup() {
Serial.begin(9600);
pinMode(LDR, INPUT); // declare the LDR as an INPUT
}
void loop()
{
int photocellReading0 = analogRead(A5); // Read the analogue pin
float volts0=photocellReading0*0.004887585532746823069403714565; // calculate the voltage
Serial.print(volts0); //raw voltage
Serial.println(" Volts.");
Serial.print((500/((10.72/(5-volts0))*volts0)), 2); //lux calculation
Serial.print(" Lux.");
Serial.println("");
delay(1000); //delay for a second
}
I have a very cheap lux meter and I've worked out the percentage difference between my arduino light meter and it as an average of 5.56% over 7 different lights (from dark to sunlight) so I pretty certain that, that's as close as I'm going to get to a true lux reading using a tiny LDR and my arduino.
Hope that helps someone

Ollie