Skip to content

Modifications to work with the ESP32 #2

Open
@PeterAJansen

Description

@PeterAJansen

Thanks for creating this!

Here are a few issues and fixes I noted when getting this to compile for the ESP32 (Arduino IDE 1.8.5), in case anyone else attempts the same:

  1. MLX90640_I2C_Driver.cpp:
    Add #include<Arduino.h> at the top, or it will throw errors on Serial() for the debug print statements. (Alternatively, these can be commented out).

  2. Setup() functions of example code:
    Wire.setClock(400000): This seems to make communication unreliable, possibly due to some potential issues with the ESP32 Arduino I2C library itself (I noted some issues mentioned on github, but didn't dig too deep). Commenting this out so that it uses the default 100khz speed seems to get it working. A speed of 200Khz also seems to work some of the time.

  3. I2C reliability:
    Sometimes it gives a 'failure to find the MLX90640 at the default I2C address' error, and sometimes it doesn't -- when this happens, resetting the ESP32 (using the reset button) seems to get things working after some number of resets. I still haven't figured this one out yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions