Arduino101 加速度传感器

« 返回首页

Arduino101 加速度传感器

The Arduino101Accelerometer component lets users configure the Arduino 101’s on-board accelerometer and receive one or more accelerometer samples via the appropriate methods.

More links:<ul><li>Download a sample project for the Arduino 101 Accelerometer.</li><li>View the how to instructions for the Arduino 101 Accelerometer.</li></ul>

Properties

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

get Arduino101Accelerometer1 BluetoothDevice

set Arduino101Accelerometer1 BluetoothDevice  to

Methods

  • IsSupported – Check whether the accelerometer is currently available for the device connected via the BluetoothDevice property. If no device is currently connected, this method will always return false.

call Arduino101Accelerometer1 IsSupported

  • ReadAccelerometerData – Read a single sample of accelerometer data from the Arduino. On successful read, the AccelerometerDataReceived event will be run.

call Arduino101Accelerometer1 ReadAccelerometerData

  • RequestAccelerometerDataUpdates – Request notifications of changes in the Arduino’s accelerometer. Accelerometer data will be reported through the AccelerometerDataReceived event.

call Arduino101Accelerometer1 RequestAccelerometerDataUpdates

  • 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 the AccelerometerDataReceived event.

call Arduino101Accelerometer1 StopAccelerometerDataUpdates

Events

  • AccelerometerDataReceived – The AccelerometerDataReceived 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>) &mdash; 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>) &mdash; 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>) &mdash; The Z value of the accelerometer, in G.

when Arduino101Accelerometer1 AccelerometerDataReceived Accelerometer_X Accelerometer_Y Accelerometer_Z do