It sounds to me like you want to measure the intensity of the light returned? If so, read ahead, otherwise, skip this post.
Quite frankly, this is <i>impossible</i>.
Why?
Because, the light sensor is a switch. It has two valid outputs: on or off. In essence, this means that it is a digital sensor, representing a binary 1 or 0: on or off.
In order to measure the intensity of the light, the sensor would have to output some value that fits into a range; say 0 to 255. That would qualify it as an analog sensor.
Hence, whenever you have something that is either on or off, it is labeled as a digital signal/sensor.
Glancing above it looks like you’re trying to keep some sort of record of the last 255 states of the light sensor… I dont see how this could assist much. The resulting byte will not be an intensity measure.
To sum it all up, you can not measure the intensity of the light (no way reliably).
This can also be seen by the little schematic on the side of the light sensor (LAST YEAR BECAUSE WE HAVENT GOTTEN THIS YEAR’S GRR).
It details four connections: two inputs (V+, V-), and two outputs.
The two outputs are in a switch circuit… one is on the other is off, or vice versa.
Although some sort of variable resistor <b>may</b> be used in the circuitry of the sensor, <b>no</b> variable resistor is detailed in the schematic.
Bleh, all this rambling has gotten me off topic… it’s a digital sensor, on or off, no way to measure intensity… only to measure the intensity at which the switch flips (which reminds me there must be a variable component in there because of the wheel on the back…).
Time to explore the other threads. Hope this helps clear things up.