Component: Magnetometer 3 Axis (QMC5883L) (Movement & Orientation)

From Flowcode Help
Revision as of 15:31, 6 August 2019 by BenR (talk | contribs) (XML import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Author Matrix TSL
Version 1.6 (Release)
Category Movement & Orientation


Image Magnetometer 3_Axis (QMC5883L) component

QMC5883L 3-Axis Magnetometer sensor Useful for working out data such as compass orientation.

Examples

No additional examples


Downloadable macro reference

Read_Register

Reads a value from a register on the accelerometer.

Parameters

BYTE Reg


Return value

BYTE


UpdateCompassData

Reads from the compass and updates the local XYZ variables.

Returns 1 for new data and 0 for no new data

Parameters

This macro has no parameters


Return value

BYTE


Write_Register

Writes a data value to a specific register on the accelerometer

Parameters

BYTE Reg
BYTE Data


Return value

BYTE


CollectXYZData

Collect the data from the local accelerometer buffers.

The Axis parameter specifies the Axis to be read.

0 / 'x' / 'X' - X axis

1 / 'y' / 'Y' - Y axis

2 / 'z' / 'Z' - Z axis

Parameters

BYTE Axis


Return value

INT


Read_Bearing

Reads the current sensor compass bearing based on degrees CW from magnetic north.

Returns 0-359 where 0 = North, 90 = East, 180 = South, 270 = West

Requires the ArcTan floating point function to be available to work correctly.

Supported on AVR, 16-bit

Parameters

BYTE NumSamples
The number of readings to base the bearing on


Return value

UINT


Initialise

Sets up up the communication bus and initialises the accelerometer module.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

SimSetCompass

Allows the XYZ slider values to be set via the simulation

Parameters

INT X
INT Y
INT Z


Return value

This call does not return a value



Property reference

Bit Depth

This property is of type Signed integer and can be referenced with the variable name bit_depth.

No additional information


Compass Data Rate

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

Sets the output conversion rate.

Oversample Ratio

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

No additional information


Compass Scale

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

No additional information


Channel

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

Channel selection

Baud Select

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

Baud rate option selector

Baud Rate

This property is of type Signed integer and can be referenced with the variable name cal_i2c::BAUD.

Baud rate to be used

Stop Delay

This property is of type True or false and can be referenced with the variable name cal_i2c::StopDel.

On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not

a 10ms delay between an I2C stop event and the next I2C start event.


Most modern microcontrollers will not have a problem so this property can be disabled to speed up the

I2C communications.

SDA

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

Pin used for SDA (data signal)

SCL

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

Pin used for SCL (clock signal)

Use RDY Pin

This property is of type True or false and can be referenced with the variable name UseRDY.

No additional information


Simulation GUI

This property is of type True or false and can be referenced with the variable name SimulationGUI.

Yes: Accelerometer data will come from the simulation component sliders.

No: Accelerometer data will come from the I2C CAL component - Injector etc

Scope Traces

This property is of type True or false and can be referenced with the variable name cal_i2c::ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name cal_i2c::ConsoleData.

Selects if the console data is automatically generated or not

Injector

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

No additional information