First i used the method from the book "getting started with arduino", then someone told me it's wrong:
I think the LDR is set up wrong. The way that works for me is:
+5V-----[resistor]------ --------[LDR]--------Gnd | | | | Arduino pin
This forms a voltage divider; the voltage on the arduino pin is therefore dependant on both the fixed resistor resistance and the LDR resistance/
My "wrong" method worked btw (but it could burn my LDR out after a while i was told):
+5V-----[LDR]-----[RESISTOR]--------Gnd | | | | Arduino pin
Anyway, before the more light there was coming in the ldr the higher the value was. Now it's the other way around, the darker it get's the higher the value, even if i rotate the ldr 180degrees. I can easilly fix it by code to get the result i want, however i would like to understand why this is cause it doesn't make sense to me.