Description
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:
-
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). -
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. -
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.