Arduino101 光线传感器

« 返回首页

Arduino101LightSensor 光线传感器

Arduino 101 光传感器组件允许用户从连接到 Arduino 的光传感器接收数据,但它也适用于任何基于某些外部现象提供线性模拟信号的类似设备。

更多链接

属性

  • BluetoothDevice – 连接到Arduino 101的BluetoothLE组件。

get Arduino101LightSensor1 BluetoothDevice

set Arduino101LightSensor1 BluetoothDevice  to

  • Pin – 设备连接的Arduino板上的引脚。

get Arduino101LightSensor1 Pin

set Arduino101LightSensor1 Pin  to

方法

  • IsSupported – 测试蓝牙低功耗设备是否广播支持该服务。如果为true, 调用TurnOn和TurnOff应该能正常工作。否则会通过屏幕的ErrorOccurred事件报告错误。

call Arduino101LightSensor1 IsSupported

  • ReadLightSensor – 获取Arduino报告的光传感器最新读数。成功时, LightSensorDataReceived事件将 被触发。

call Arduino101LightSensor1 ReadLightSensor

  • RequestLightSensorUpdates – 请求获取连接到Arduino 101的光传感器更新通知。当从Arduino 接收到光传感器读数时,LightSensorDataReceived事件将被触发。

call Arduino101LightSensor1 RequestLightSensorUpdates

  • StopLightSensorUpdates – 停止监听来自Arduino的光传感器读数通知。只有之前调用过RequestLightSensorUpdates时才有效。可能还有 额外的待处理消息会在本次调用后被处理。

call Arduino101LightSensor1 StopLightSensorUpdates

事件

  • LightSensorDataReceived – 当从连接到Arduino 101的光传感器接收到样本时,LightSensorDataReceived事件将被触发。

Parameters:

 * <code>intensity</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) &mdash; The intensity of the light received from the sensor, linear in the voltage provided by the light sensor.

when Arduino101LightSensor1 LightSensorDataReceived intensity do

文档反馈