#include <Adafruit_MLX90393.h>
Driver for the Adafruit MLX90393 magnetometer breakout board.
◆ Adafruit_MLX90393()
Adafruit_MLX90393::Adafruit_MLX90393 |
( |
void |
| ) |
|
◆ begin_I2C()
bool Adafruit_MLX90393::begin_I2C |
( |
uint8_t |
i2c_addr = MLX90393_DEFAULT_ADDR , |
|
|
TwoWire * |
wire = &Wire |
|
) |
| |
Sets up the hardware and initializes I2C.
- Parameters
-
i2c_addr | The I2C address to be used. |
wire | The Wire object to be used for I2C connections. |
- Returns
- True if initialization was successful, otherwise false.
◆ begin_SPI()
boolean Adafruit_MLX90393::begin_SPI |
( |
uint8_t |
cs_pin, |
|
|
SPIClass * |
theSPI = &SPI |
|
) |
| |
Sets up the hardware and initializes hardware SPI.
- Parameters
-
cs_pin | The arduino pin # connected to chip select |
theSPI | The SPI object to be used for SPI connections. |
- Returns
- True if initialization was successful, otherwise false.
◆ reset()
bool Adafruit_MLX90393::reset |
( |
void |
| ) |
|
Perform a soft reset
- Returns
- True if the operation succeeded, otherwise false.
◆ exitMode()
bool Adafruit_MLX90393::exitMode |
( |
void |
| ) |
|
Perform a mode exit
- Returns
- True if the operation succeeded, otherwise false.
◆ readMeasurement()
bool Adafruit_MLX90393::readMeasurement |
( |
float * |
x, |
|
|
float * |
y, |
|
|
float * |
z |
|
) |
| |
Reads data from data register & returns the results.
- Parameters
-
x | Pointer to where the 'x' value should be stored. |
y | Pointer to where the 'y' value should be stored. |
z | Pointer to where the 'z' value should be stored. |
- Returns
- True on command success
◆ startSingleMeasurement()
bool Adafruit_MLX90393::startSingleMeasurement |
( |
void |
| ) |
|
Begin a single measurement on all axes
- Returns
- True on command success
◆ setGain()
bool Adafruit_MLX90393::setGain |
( |
enum mlx90393_gain |
gain | ) |
|
Sets the sensor gain to the specified level.
- Parameters
-
gain | The gain level to set. |
- Returns
- True if the operation succeeded, otherwise false.
◆ getGain()
mlx90393_gain_t Adafruit_MLX90393::getGain |
( |
void |
| ) |
|
Gets the current sensor gain.
- Returns
- An enum containing the current gain level.
◆ setResolution()
bool Adafruit_MLX90393::setResolution |
( |
enum mlx90393_axis |
axis, |
|
|
enum mlx90393_resolution |
resolution |
|
) |
| |
Sets the sensor resolution to the specified level.
- Parameters
-
axis | The axis to set. |
resolution | The resolution level to set. |
- Returns
- True if the operation succeeded, otherwise false.
◆ getResolution()
enum mlx90393_resolution Adafruit_MLX90393::getResolution |
( |
enum mlx90393_axis |
axis | ) |
|
Gets the current sensor resolution.
- Parameters
-
- Returns
- An enum containing the current resolution.
◆ setFilter()
bool Adafruit_MLX90393::setFilter |
( |
enum mlx90393_filter |
filter | ) |
|
Sets the digital filter.
- Parameters
-
filter | The digital filter setting. |
- Returns
- True if the operation succeeded, otherwise false.
◆ getFilter()
enum mlx90393_filter Adafruit_MLX90393::getFilter |
( |
void |
| ) |
|
Gets the current digital filter setting.
- Returns
- An enum containing the current digital filter setting.
◆ setOversampling()
bool Adafruit_MLX90393::setOversampling |
( |
enum mlx90393_oversampling |
oversampling | ) |
|
Sets the oversampling.
- Parameters
-
oversampling | The oversampling value to use. |
- Returns
- True if the operation succeeded, otherwise false.
◆ getOversampling()
enum mlx90393_oversampling Adafruit_MLX90393::getOversampling |
( |
void |
| ) |
|
Gets the current oversampling setting.
- Returns
- An enum containing the current oversampling setting.
◆ setTrigInt()
bool Adafruit_MLX90393::setTrigInt |
( |
bool |
state | ) |
|
Sets the TRIG_INT pin to the specified function.
- Parameters
-
state | 'true/1' sets the pin to INT, 'false/0' to TRIG. |
- Returns
- True if the operation succeeded, otherwise false.
◆ readData()
bool Adafruit_MLX90393::readData |
( |
float * |
x, |
|
|
float * |
y, |
|
|
float * |
z |
|
) |
| |
Performs a single X/Y/Z conversion and returns the results.
- Parameters
-
x | Pointer to where the 'x' value should be stored. |
y | Pointer to where the 'y' value should be stored. |
z | Pointer to where the 'z' value should be stored. |
- Returns
- True if the operation succeeded, otherwise false.
◆ getEvent()
bool Adafruit_MLX90393::getEvent |
( |
sensors_event_t * |
event | ) |
|
Gets the most recent sensor event, Adafruit Unified Sensor format.
- Parameters
-
event | Pointer to an Adafruit Unified sensor_event_t object that we'll fill in |
- Returns
- True on successful read
◆ getSensor()
void Adafruit_MLX90393::getSensor |
( |
sensor_t * |
sensor | ) |
|
Gets the sensor_t device data, Adafruit Unified Sensor format.
- Parameters
-
sensor | Pointer to an Adafruit Unified sensor_t object that we'll fill in |
The documentation for this class was generated from the following files: