I've hooked up an LDR to a Teensy 3.2 board (3.3V) which also has a switch, an LED, and a 74HC595 Shift Register connected.
The LDR is connected one side to the power rail on the breadboard (3.3V) and the other side to A0 and a 10K resistor to ground. I've correctly configured A0 as an input and in loop() I'm reading the sensor as follows:
inputLDR = analogRead(pinLDR);
When I first upload the sketch, the readings fluctuate from around 792 to 965. When I shine a bright light on the LDR, the readings are much the same. When I turn the light off, the readings are again almost the same. I thought maybe it was a faulty LDR, so I tried another one, but got the same results.
Am I doing something wrong? How to investigate? Why are the readings so unpredictable?