Adafruit MLX90640 Sensor Library
Public Member Functions | Public Attributes | List of all members
Adafruit_MLX90640 Class Reference

Class that stores state and functions for interacting with the MLX90640 sensor. More...

#include <Adafruit_MLX90640.h>

Public Member Functions

 Adafruit_MLX90640 ()
 Instantiates a new MLX90640 class.
 
boolean begin (uint8_t i2c_addr=MLX90640_I2CADDR_DEFAULT, TwoWire *wire=&Wire)
 Sets up the hardware and initializes I2C. More...
 
mlx90640_mode_t getMode (void)
 Get the frame-read mode. More...
 
void setMode (mlx90640_mode_t mode)
 Set the frame-read mode. More...
 
mlx90640_resolution_t getResolution (void)
 Get resolution for temperature precision. More...
 
void setResolution (mlx90640_resolution_t res)
 Set resolution for temperature precision. More...
 
mlx90640_refreshrate_t getRefreshRate (void)
 Get max refresh rate. More...
 
void setRefreshRate (mlx90640_refreshrate_t res)
 Set max refresh rate - too fast and we can't read the the pages in time, start low and then increment while speeding up I2C! More...
 
int getFrame (float *framebuf)
 Read 2 pages, calculate temperatures and place into framebuf. More...
 
float getTa (bool newFrame=true)
 Return ambient temperature of the TO39 package. More...
 

Public Attributes

uint16_t serialNumber [3]
 Unique serial number read from device.
 

Detailed Description

Class that stores state and functions for interacting with the MLX90640 sensor.

Member Function Documentation

◆ begin()

boolean Adafruit_MLX90640::begin ( uint8_t  i2c_addr = MLX90640_I2CADDR_DEFAULT,
TwoWire *  wire = &Wire 
)

Sets up the hardware and initializes I2C.

Parameters
i2c_addrThe I2C address to be used.
wireThe Wire object to be used for I2C connections.
Returns
True if initialization was successful, otherwise false.

◆ getMode()

mlx90640_mode_t Adafruit_MLX90640::getMode ( void  )

Get the frame-read mode.

Returns
Chess or interleaved mode

◆ setMode()

void Adafruit_MLX90640::setMode ( mlx90640_mode_t  mode)

Set the frame-read mode.

Parameters
modeChess or interleaved mode

◆ getResolution()

mlx90640_resolution_t Adafruit_MLX90640::getResolution ( void  )

Get resolution for temperature precision.

Returns
The desired resolution (bits)

◆ setResolution()

void Adafruit_MLX90640::setResolution ( mlx90640_resolution_t  res)

Set resolution for temperature precision.

Parameters
resThe desired resolution (bits)

◆ getRefreshRate()

mlx90640_refreshrate_t Adafruit_MLX90640::getRefreshRate ( void  )

Get max refresh rate.

Returns
How many pages per second to read (2 pages per frame)

◆ setRefreshRate()

void Adafruit_MLX90640::setRefreshRate ( mlx90640_refreshrate_t  rate)

Set max refresh rate - too fast and we can't read the the pages in time, start low and then increment while speeding up I2C!

Parameters
rateHow many pages per second to read (2 pages per frame)

◆ getFrame()

int Adafruit_MLX90640::getFrame ( float *  framebuf)

Read 2 pages, calculate temperatures and place into framebuf.

Parameters
framebuf24*32 floating point memory buffer
Returns
0 on success

◆ getTa()

float Adafruit_MLX90640::getTa ( bool  newFrame = true)

Return ambient temperature of the TO39 package.

Parameters
newFrameIf true, will also capture a new data frame. If false, return the value from the last data frame read.
Returns
Ambient temperature as a float in degrees Celsius.

The documentation for this class was generated from the following files: