Component: Accel Mag 6 Axis (LSM303DLHC) (Sensors)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 2.0 (Release)
Category Sensors


Image Accel Mag 6_Axis (LSM303DLHC) component

LSM303DLHC Combined 6-Axis Accelerometer and Magnetometer sensors Useful for working out data such as Pitch and Yaw.

Examples

No additional examples


Downloadable macro reference

SimReset1G

No additional information


Parameters

This macro has no parameters


Return value

This call does not return a value


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


SimSetAccelerometer

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


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


UpdateAccelerometerData

Reads from the accelerometer 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


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


Initialise

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

Returns 0 for success and > 0 for fail.

Parameters

This macro has no parameters


Return value

BYTE


Simulation macro reference

This component does not contain any simulation macros


Property reference

Power Mode

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

No additional information


Accel Data Rate

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

No additional information


Accel Scale

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

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.

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


Comms Mode

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

Specifies the communications mode.

Interrupt - Wait for the interrupt pin to go high before allowing new data to be sampled.

Polling - New data is sampled without needing to check the interrupt pin.

Bit Depth

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

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)

Interrupt Pin

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

No additional information


Sim Type

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

Controls how the simulation data is generated, via the component GUI or via a I2C injector.

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