Component: Accel Gyro 6 Axis (MPU-6050) (Sensors)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 2.0 (Release)
Category Sensors


Image Accel Gyro 6_Axis (MPU-6050) component

MPU-6050 Combined 6-Axis Accelerometer and Gyroscope sensors. Useful for working out data such as Pitch and Roll. Can be combined with a Magnetometer to also provide Yaw.

Examples

No additional examples


Downloadable macro reference

GetAccelReading

Collects one of the accelerometer readings from the last sample.

Parameters

BYTE Axis
0=X, 1=Y, 2=Z


Return value

INT


GetTempReadingReal

Collects the temperature reading in degrees C as a floating point value.

Parameters

This macro has no parameters


Return value

FLOAT


SampleDevice

Collects the accelerometer, gyro and temperature readings from the device,

Parameters

This macro has no parameters


Return value

This call does not return a value


GetGyroReadng

Collects one of the gyroscope readings from the last sample.

Parameters

BYTE Axis
0=X, 1=Y, 2=Z


Return value

INT


GetTempReadingInt

Collects the temperature reading in degrees C as an integer value.

Parameters

This macro has no parameters


Return value

INT


ReadRegister

Reads the value from one of the registers onboard the device.

Parameters

BYTE Address


Return value

BYTE


WriteRegister

Sets the value of one of the registers on the device.

Parameters

BYTE Address
BYTE Value


Return value

This call does not return a value


Initialise

Startup the I2C bus and configure the device.

Returns 0 if the device is ok and 255 if the device is not responding correctly.

Parameters

This macro has no parameters


Return value

BYTE


Simulation macro reference

This component does not contain any simulation macros


Property reference

Address Bit AD0

This property is of type Unsigned integer and can be referenced with the variable name AddressBit.

No additional information


Gyro Range

This property is of type Fixed list of ints and can be referenced with the variable name GyroRange.

No additional information


Accel Range

This property is of type Fixed list of ints and can be referenced with the variable name AccelRange.

No additional information


Channel

This property is of type Fixed list of ints and can be referenced with the variable name CHANNEL.

No additional information


Data (SDA)

This property is of type Single digital pin and can be referenced with the variable name SDA.

No additional information


Clock (SCL)

This property is of type Single digital pin and can be referenced with the variable name SCL.

No additional information