readAngularVelocity

Read one sample of angular velocity from sensor

Description

example

gyroReadings = readAngularVelocity(imu) returns one sample of the angular velocity data on x, y, and z axes read from the sensor in units of rad/s.

Examples

Read Angular Velocity

Create an Arduino object and include the I2C library.

a=arduino();

Or, you can explicitly specify it in the Libraries Name-Value pair while creating the Arduino object.

clear a;
a = arduino('COM4', 'Uno', 'Libraries', 'I2C');

Create the sensor object.

imu = mpu9250(a);

Return one sample of angular velocity data.

gyroReadings = readAngularVelocity(imu)

gyroReadings =

    0.0138    0.0092    0.0034

Input Arguments

collapse all

The IMU sensor object.

Output Arguments

collapse all

The angular velocity value on x, y, and z axes read from the sensor.

Introduced in R2019a