fred7;550610 Wrote: 
> I noticed an option for testing the ambient light sensor -
> Settings->Advanced->Factory Test->Ambient Light Sensor. There are 2
> channels and I'm seeing some unusual behavior. When my room is
> completely dark the sensors read zero which I would expect. But then
> they start bouncing between zero and 65529. Being a programmer I'm
> suspecting that the 65529 is the sensor going negative but being
> interpreted incorrectly somewhere and the most significant bit being
> treated as unsigned so its getting a very large number instead of a
> negaive number. This is just a guess and I'm sure that most forum
> readers will not know what I'm trying to say. I'm hoping that this
> information will be usefull to one of the developers, of course I can
> be completely wrong. Both channels are behaving this way. When the
> lights are on the value for the channels always stay positive.

I think you may be right. (or at least something similar). It doesn't
do it for me so I can't test it. Its probably the interface between the
C code that implements the device driver and the lua code, that would be
the most likely place for something like signed to unsigned to happen.
Both C and lua should handle it properly on their own but there is
always a chance for such things to happen at the interface. 

I'll try and remember to look at this issue this weekend. I've run
across the code for this before so I know where to look. 

If it in lua code than it can be patched and someone who has the
problem can try it. If its in the C code that takes a new firmware
release. 

My guess is that there is an analog light sensor feeding am ADC which
has a reference voltage so "darkness" on the sensor comes out as zero
count. Manufacturing tolerances on either the sensor or ADC or voltage
reference are causing the count to go negative. If this is the case
then some people will have the problem and others will not. And it
probably is temperature dependent. That might be an interesting test
for those that have the problem, try it at hot or cold temperatures and
see if the behavior changes. 

Hopefully the fix is just clamping to zero before converting to
unsigned or clamping and leaving signed. 

John S.


-- 
JohnSwenson
------------------------------------------------------------------------
JohnSwenson's Profile: http://forums.slimdevices.com/member.php?userid=5974
View this thread: http://forums.slimdevices.com/showthread.php?t=79057

_______________________________________________
Touch mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/touch

Reply via email to