Main Content
readOrientation
Read orientation data from BNO055 sensor
Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.
Description
Examples
Read Orientation from Sensor
Create an arduino
object
a = arduino('COM4', 'Uno', 'Libraries', 'I2C');
Create the BNO055 sensor object.
imu = bno055(a,'OperatingMode','ndof');
Calibrate the sensor using steps mentioned in Calibrate BNO055 Sensors
tic; while (toc < 120) [status,timestamp] = readCalibrationStatus(imu); if strcmpi(status.System,'full') && strcmpi(status.Magnetometer,'full') && strcmpi(status.Accelerometer,'full') && strcmpi(status.Gyroscope,'full') break; %System is calibrated proceed further end end
Read orientation data.
[readVal,timestamp] = readOrientation(imu)
readVal = 3×1 6.2046 3.0729 -0.3011 timestamp = datetime datetime 21-Jul-2020 14:09:57.615
Input Arguments
Output Arguments
More About
Version History
Introduced in R2019b
See Also
bno055
| flush
| info
| read
| readAcceleration
| readAngularVelocity
| readCalibrationStatus
| readMagneticField
| release