View Source Mlx90640 (elixir_mlx90640 v0.1.12)

elixir_mlx90640 provides a high level abstraction to interface with the MLX90640 Far Infrared Thermal Sensor Array on Linux platforms.

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Gracefully stops the Mlx90640 GenServer.

Types

@type frame_rate() :: 1 | 2 | 4 | 8 | 16 | 32 | 64

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for GenServer.init/1.

Link to this function

start_link(receiver, mlx_opts \\ [], opts \\ [])

View Source
@spec start_link(pid(), [{:frame_rate, frame_rate()}], [term()]) ::
  GenServer.on_start()

Starts and links the Mlx90640 GenServer.

receiver is a process that will receive messages on each frame captured by the sensor.

frame_rate is the (approximate) number of frames per second that the sensor will capture. Valid values are 1, 2, 4, 8, 16, 32, and 64. The default is 2. Higher values might require a faster I2C baud rate to be configured in Linux.

The receiver process will receive, for each frame captured by the sensor, a message like %Mlx90640.Frame{ data: data }, where data is a list of rows, and each row is a list of pixel temperature measurements, expressed as floating point numbers indicating the temperature in degrees Celsius.

Under normal conditions, there should be 24 rows of 32 pixels each, but in case of corrupted data frames there might be less.

@spec stop(GenServer.server()) :: :ok

Gracefully stops the Mlx90640 GenServer.