Component: Magnetometer (BMM150) (Environmental)

From Flowcode Help
Jump to navigationJump to search
Author MatrixTSL
Version 1.0
Category Environmental


Magnetometer (BMM150) component

A low-power, low-noise 3-axis digital geomagnetic sensor that perfectly matches the requirements of compass applications.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Magnetometer_BMM150.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Magnetometer_BMM150.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

Initialise

Fc9-comp-macro.png Initialise
Startup communications to the sensor module. Puts the device into normal operating and preset modes. Returns 1 if module found and communicating. 
Fc9-u8-icon.png - BYTE Return


ReadRegister

Fc9-comp-macro.png ReadRegister
A simple example showing a generic way to read a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Return


ReadSample

Fc9-comp-macro.png ReadSample
Collect a sample fromt he last SampleMag operation 
Fc9-u8-icon.png - BYTE Axis
0=X, 1=Y, 2=Z 
Fc9-s16-icon.png - INT Return


SampleMagData

Fc9-comp-macro.png SampleMagData
Samples the magnetometer and processes the data ready to be read out using the read sample macro. 
Fc9-bool-icon.png - BOOL ApplyTrim
0=ReadRawValues, 1=ApplyCalibrationTrim 
Fc9-void-icon.png - VOID Return


SetOperatingMode

Fc9-comp-macro.png SetOperatingMode
Select the operating mode and power level used by the device 
Fc9-u8-icon.png - BYTE Mode
0=Normal, 1=Forced, 3=Sleep, 4=Suspend 
Fc9-void-icon.png - VOID Return


SetPresetMode

Fc9-comp-macro.png SetPresetMode
Controls the device sample rate and accuracy 
Fc9-u8-icon.png - BYTE Mode
0=LowPower, 1=Normal, 2=HighAccuracy, 3=Enhanced 
Fc9-void-icon.png - VOID Return


WriteRegister

Fc9-comp-macro.png WriteRegister
A simple example showing a generic way to write a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Component Properties
Fc9-type-16-icon.png Device Address
 
Fc9-type-16-icon.png Preset
Sets the default preset for the module. Can be overridden by calling the SetPresetMode component macro. 
Fc9-conn-icon.png I2C Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-16-icon.png SDA Remap Pin
 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png SCL Remap Pin
 
Fc9-conn-icon.png Options
Fc9-type-7-icon.png Stop Delay
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.  
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms