Arduino101 近距离传感器

« 返回首页

Arduino101ProximitySensor 近距离传感器

Arduino 101 近距离传感器允许用户从红外近距离传感器接收数据。请注意,Grove 接口上的信号线可能存在一个引脚的偏差。如果您没有收到传感器的任何读数,可能需要将引脚号增加 1(将 A0 改为 A1)才能读取正确的引脚。 Arduino 草图根据夏普发布的规格表将传感器的原始读数转换为以厘米为单位的距离。

更多链接<ul><li>下载 Arduino 101 近距离传感器的示例项目。</li><li>查看 Arduino 101 近距离传感器的操作说明。</li><li>查看硬件数据表.</li></ul>

属性

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

get Arduino101ProximitySensor1 BluetoothDevice

set Arduino101ProximitySensor1 BluetoothDevice  to

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

get Arduino101ProximitySensor1 Pin

set Arduino101ProximitySensor1 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 Arduino101ProximitySensor1 IsSupported

  • ReadProximity – Obtain the most recent reading from the proximity sensor as reported by the Arduino. On success, the ProximityReceived event will be run.

call Arduino101ProximitySensor1 ReadProximity

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

call Arduino101ProximitySensor1 RequestProximityUpdates

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

call Arduino101ProximitySensor1 StopProximityUpdates

事件

  • ProximityReceived – The <codeProximityReceived</code> event is run when a proximity measurement is received from the proximity sensor attached to the Arduino 101.

Parameters:

 * <code>proximity</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) &mdash;
   The proximity of an object from the sensor. Due to physical and mathematical
   limitations, this value will range from 6 to 80 cm.

when Arduino101ProximitySensor1 ProximityReceived proximity do

文档反馈