Hi 

I wanted the sensor to send me the light value it
detects only if its value is above  a particular
threshold. I used XSensorMTS300 and xlisten, TOSBase.
I modified th nesC code in TestSensorM.nc 

msg_uart->data[PHOTO] = data & 0xff;
      msg_uart->data[PHOTO+1] = data >> 8;

to if(data>ALPHA){msg_uart->data[PHOTO] = data &
0xff;}
           else{msg_uart->data[PHOTO]=0 & 0xff;}
      msg_uart->data[PHOTO+1] = data >> 8;

I expect the output to be around 2345ADC which is the
normal light in the room. and when i cover it to
become 0 if my threshold is less than 2345ADC.

But I get light= 0000 or 0100 or 0200 or 0300
depending on the amount of light the sensor is exposed
to.

my guess is its doing some kind of averaging. If so
where is the code where the averaging is performed?
another guess is its related to the temp/photo Pin
being shared.

Can someone please tell me what is wrong, any help
would be highly appreciated.

Thanks in advance.
SS.








__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to