View Single Post
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#32
Originally Posted by jaeezzy View Post
Coz all I'm doing now is reading the files from /sys/class/hwmon/hwmon1/device/ namely adc0 and adc1 every 1 second and as they return numeric values, I'm just using that to turn speakers on/off. Can someone plz tell what they are actually, coz they are giving random results in different scenarios like I mentioned above and from what I found in the web, it is suppose to give proximity value.
That would be due to those being the values for the light sensor... You want the file "/sys/bus/platform/devices/proximity/state" which can have a state of "open" or "closed".

P.S. GIOChannels provide a nicer alternative to watching files.

Last edited by qwerty12; 2010-03-20 at 08:15. Reason: 'l', even
 

The Following User Says Thank You to qwerty12 For This Useful Post: