关于iphone中的Ambient Light传感器

时间:2021-10-05 09:20:00

Thanks in advance.

提前致谢。

I got the information about the iphone sensors from http://ipod.about.com/od/ipodiphonehardwareterms/qt/iphone-sensors.htm. But I didn't get information about how to use ambient sensor in iphone

我从http://ipod.about.com/od/ipodiphonehardwareterms/qt/iphone-sensors.htm获得了有关iphone传感器的信息。但我没有得到有关如何在iPhone中使用环境传感器的信息

2 个解决方案

#1


3  

It is possible, and the framework is public.

这是可能的,框架是公开的。

You can activate the connection to the sensor like so :

您可以激活与传感器的连接,如下所示:

[[UIDevice currentDevice] setProximityMonitoringEnabled:YES]; 

BTW, it doesn't seem to be using the light sensor, because proximity sensing would tweak out in a dark room.

顺便说一句,它似乎没有使用光传感器,因为接近感应会在黑暗的房间里调整。

However, the API call basically blanks the screen when you hold the phone up to your face. Not useful for interaction, sadly.

但是,当您将手机拿到脸上时,API调用基本上会使屏幕空白。遗憾的是,对交互没用。

Here is a guide about iPhone sensors : iPhone sensors

以下是有关iPhone传感器的指南:iPhone传感器

#2


7  

Here's a link to a description of the ambient light sensor hardware with example code that shows how to access it.

这是环境光传感器硬件描述的链接,其示例代码显示了如何访问它。

#1


3  

It is possible, and the framework is public.

这是可能的,框架是公开的。

You can activate the connection to the sensor like so :

您可以激活与传感器的连接,如下所示:

[[UIDevice currentDevice] setProximityMonitoringEnabled:YES]; 

BTW, it doesn't seem to be using the light sensor, because proximity sensing would tweak out in a dark room.

顺便说一句,它似乎没有使用光传感器,因为接近感应会在黑暗的房间里调整。

However, the API call basically blanks the screen when you hold the phone up to your face. Not useful for interaction, sadly.

但是,当您将手机拿到脸上时,API调用基本上会使屏幕空白。遗憾的是,对交互没用。

Here is a guide about iPhone sensors : iPhone sensors

以下是有关iPhone传感器的指南:iPhone传感器

#2


7  

Here's a link to a description of the ambient light sensor hardware with example code that shows how to access it.

这是环境光传感器硬件描述的链接,其示例代码显示了如何访问它。