メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

LIS3MDL Magnetometer Sensor

Measure magnetic field strength and temperature from LIS3MDL Magnetometer sensor

R2021b 以降

  • block icon for LIS3MDL Magnetometer sensor

ライブラリ:
Simulink Coder Support Package for STMicroelectronics Nucleo Boards / Sensors

Description

The LIS3MDL Magnetometer Sensor block outputs the values of magnetic field strength along x-, y- and z- axes as measured by the LIS3MDL Magnetometer sensor connected to Nucleo/STM32L475-Discovery board. The block also outputs the temperature as read by the LIS3MDL Magnetometer sensor.

端子

Output

すべて展開する

Magnetic field strength (in µT) measured by LIS3MDL sensor connected to Nucleo/STM32L475-Discovery board, along the x-, y- and z- axes, specified as a row vector [x,y,z].

Dependencies

This output port appears only if you select the Magnetic Field (µT) parameter.

データ型: double

Temperature (in ℃) measured by LIS3MDL sensor connected to Nucleo/STM32L475-Discovery board.

Dependencies

This output port appears only if you select the Temperature (℃) parameter.

データ型: double

Status of magnetic and temperature measurements, specified as a 1-by-2 vector. 0 indicates that the data read is new, 1 indicates that the data read is not new, and -1 indicates that the corresponding output is not selected.

Dependencies

This output port appears only if you select the Status parameter.

データ型: int8

Parameters

すべて展開する

Main Tab

Specify the I2C module on the board. The I2C bus frequency, serial clock (SCL) pin and serial data (SDA) pin are taken according to the corresponding I2C module entry in the configuration parameters.

Select this parameter to set Magnetic Field as one of the output ports.

Select this parameter to set Temperature as one of the output ports.

Select this parameter to set Magnetic Field Status as one of the output ports.

Specify how often this block reads the data from the LIS3MDL sensor. When you set this parameter to -1, Simulink determines the best sample time for the block based on the block context within the model.

Advanced Tab

Select the full scale for measuring linear acceleration (the range of acceleration that the sensor needs to measure).

Select the output data rate at which magnetometer data is sampled.

拡張機能

すべて展開する

C/C++ コード生成
Simulink® Coder™ を使用して C および C++ コードを生成します。

バージョン履歴

R2021b で導入