Arduino101 光线传感器

« 返回首页

Arduino101LightSensor 光线传感器

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

更多链接<ul><li>下载示例项目</li><li>查看 Arduino 101 光传感器的使用说明。</li></ul>

属性

  • BluetoothDevice – The BluetoothLE component with a connection to the Arduino 101.

get Arduino101LightSensor1 BluetoothDevice

set Arduino101LightSensor1 BluetoothDevice  to

  • Pin – The Pin on the Arduino board that the device is wired in to.

get Arduino101LightSensor1 Pin

set Arduino101LightSensor1 Pin  to

方法

  • IsSupported – Tests whether the Bluetooth low energy device is broadcasting support for the service. If true, calls to TurnOn and TurnOff should work correctly. Otherwise an error will be reported through the Screen’s ErrorOccurred event.

call Arduino101LightSensor1 IsSupported

  • ReadLightSensor – Obtain the most recent reading from the light sensor as reported by the Arduino. On success, the LightSensorDataReceived event will be run.

call Arduino101LightSensor1 ReadLightSensor

  • RequestLightSensorUpdates – Request notification of updates for the light sensor attached to the Arduino 101. The LightSensorDataReceived event will be run as light sensor readings are received from the Arduino.

call Arduino101LightSensor1 RequestLightSensorUpdates

  • StopLightSensorUpdates – Stop listening for notifications of light sensor readings from the Arduino. This only has an effect if there was a previous call to RequestLightSensorUpdates. There may be additional pending messages that will be processed after this call.

call Arduino101LightSensor1 StopLightSensorUpdates

事件

  • LightSensorDataReceived – The LightSensorDataReceived event is run when a sample is received from the light sensor attached to the Arduino 101.

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

文档反馈