Arduino101 陀螺仪
The Arduino101Gyroscope component lets users configure the Arduino 101’s on-board gyroscope and receive one or more gyroscope samples via the appropriate methods.
More links:<ul><li>View the sample project for the Arduino 101 Gyroscope.</li><li>View the how to instructions for the Arduino 101 Gyroscope.</li></ul>
Properties
BluetoothDevice
– The BluetoothLE component with a connection to the Arduino 101.
Methods
IsSupported
– Check whether the feature is currently available for the device connected via theBluetoothDevice
property. If no device is currently connected, this method will always return false.
ReadGyroscopeData
– Read a single sample of gyroscope data from the Arduino. On successful read, theGyroscopeDataReceived
event will be run.
RequestGyroscopeDataUpdates
– Request notifications of changes in the Arduino’s gyroscope. Gyroscope data will be reported through theGyroscopeDataReceived
event.
StopGyroscopeDataUpdates
– Stop receiving updates from the Arduino’s gyroscope. Note that there may be pending messages from the device that will still be reported through theGyroscopeDataReceived
event. This method has no effect ifRequestGyroscopeDataUpdates
has not been previously called.
Events
GyroscopeDataReceived
– TheGyroscopeDataReceived
event is run whenever gyroscope samples are received from the Arduino 101. This is usually a result of performing a read or request operation. The X and Y angles are reported in degrees.
Parameters:
* <code>X_Angle</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The rotation of the device around its X axis, in degrees.
* <code>Y_Angle</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The rotation of the device around its Y axis, in degrees.