Treehopper C# API
|
InvenSense MPU6050 6-DoF IMU More...
Classes | |
class | Mpu6050Registers |
Public Types | |
enum | ExtSyncSets { Disabled = 0, TempOutL = 1, GyroXoutL = 2, GyroYoutL = 3, GyroZoutL = 4, AccelXoutL = 5, AccelYoutL = 6, AccelZoutL = 7 } |
enum | GyroScales { Dps_250 = 0, Dps_500 = 1, Dps_1000 = 2, Dps_2000 = 3 } |
enum | AccelScales { Fs_2g = 0, Fs_4g = 1, Fs_8g = 2, Fs_16g = 3 } |
enum | ClockSels { InternalOscillator = 0, AutoSelect = 1, Reset = 7 } |
Public Member Functions | |
Mpu6050 (I2C i2c, bool addressPin=false, int ratekHz=400) | |
Construct an MPU9150 9-Dof IMU More... | |
override async Task | UpdateAsync () |
Requests a reading from the sensor and updates its data properties with the gathered values. More... | |
virtual async Task | Calibrate () |
Calibrate IMU relative to gravity More... | |
Static Public Member Functions | |
static async Task< IList< Mpu6050 > > | ProbeAsync (I2C i2c, bool includeMpu9250=false, int rate=100) |
Discover any MPU6050 IMUs (or optionally MPU9250s) attached to the specified bus. More... | |
Protected Attributes | |
Mpu6050Registers | _registers |
Properties | |
AccelScales | AccelerometerScale [get, set] |
Gets or sets the accelerometer scale More... | |
GyroScales | GyroscopeScale [get, set] |
Gets or sets the gyroscope scale More... | |
Vector3 | Accelerometer [get] |
Gets the accelerometer data More... | |
Vector3 | Gyroscope [get] |
Gets the gyroscope data More... | |
bool | AutoUpdateWhenPropertyRead [get, set] |
Gets or sets whether reading from the sensor's properties should request updates from the sensor automatically (defaults to true ). More... | |
InvenSense MPU6050 6-DoF IMU
|
strong |
|
strong |
|
strong |
|
strong |
Construct an MPU9150 9-Dof IMU
i2c | The I2c module this module is connected to. |
addressPin | The address of the module |
ratekHz | The rate, in kHz, to use with this IC |
|
static |
Discover any MPU6050 IMUs (or optionally MPU9250s) attached to the specified bus.
i2c | The bus to probe. |
includeMpu9250 | Whether to include MPU-9250 IMUs. |
rate | The rate, in kHz, to use. |
override async Task UpdateAsync | ( | ) |
Requests a reading from the sensor and updates its data properties with the gathered values.
Note that when AutoUpdateWhenPropertyRead is true
(which it is, by default), this method is implicitly called when any sensor data property is read from — there's no need to call this method unless you set AutoUpdateWhenPropertyRead to false
.
Unless otherwise noted, this method updates all sensor data simultaneously, which can often lead to more efficient bus usage (as well as reducing USB chattiness).
Implements IPollable.
|
virtual |
Calibrate IMU relative to gravity
|
protected |
|
getset |
Gets or sets the accelerometer scale
|
getset |
Gets or sets the gyroscope scale
|
get |
Gets the accelerometer data
|
get |
Gets the gyroscope data
|
getsetinherited |
Gets or sets whether reading from the sensor's properties should request updates from the sensor automatically (defaults to true
).
By default, whenever you access one of the properties of this sensor, a new reading will be fetched. If this property is set to false, you must manually call the UpdateAsync() method to retrieve a new sensor reading.
This functionality enables more efficient sensor updates, since it allows you to intelligently control when data is gathered.