Arduino101 加速度传感器
Arduino101 加速度传感器组件允许用户配置 Arduino 101 的板载加速度计,并通过适当的方法接收一个或多个加速度计样本。
更多链接:<ul><li>下载 Arduino 101 加速度计的示例项目。</li><li>查看 Arduino 101 加速度计的操作说明。</li></ul>
属性
BluetoothDevice
– The BluetoothLE component with a connection to the Arduino 101.
方法
IsSupported
– Check whether the accelerometer is currently available for the device connected via theBluetoothDevice
property. If no device is currently connected, this method will always return false.
ReadAccelerometerData
– Read a single sample of accelerometer data from the Arduino. On successful read, theAccelerometerDataReceived
event will be run.
RequestAccelerometerDataUpdates
– Request notifications of changes in the Arduino’s accelerometer. Accelerometer data will be reported through theAccelerometerDataReceived
event.
StopAccelerometerDataUpdates
– Stop receiving updates from the Arduino’s accelerometer. Note that there may be pending messages from the device that will still be reported through theAccelerometerDataReceived
event.
事件
AccelerometerDataReceived
– TheAccelerometerDataReceived
event is run whenever accelerometer samples are received from the Arduino 101. This is usually a result of performing a read or request operation. The X, Y, and Z values are in multiples of 1 Earth gravity (G=-9.8 m/s2).
Parameters:
+ <code>Accelerometer_X</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The X value of the accelerometer, in G.
+ <code>Accelerometer_Y</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The Y value of the accelerometer, in G.
+ <code>Accelerometer_Z</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The Z value of the accelerometer, in G.