MLX90640 Sketch not working

I want to use the MLX90640 infrared sensor, but when i compare this example from sparkfun:

but when i use the compiler i get this error in the MLX90640-I2C_Driver.cpp:

I2C_BUFFER_LENGTH’ was not declared in this scope !

I use arduino 1.8.4 but i have no idea whats wrong?

Example1_BasicReadings.ino (3.17 KB)

MLX90640_API.cpp (29.2 KB)

MLX90640_API.h (2.07 KB)

MLX90640_I2C_Driver.cpp (2.95 KB)

MLX90640_I2C_Driver.h (1.54 KB)

Please update to the newest version. There are new features and bug fixes in every newer version.

When using the ESP32, there is I2C_BUFFER_LENGTH in Wire.h

When using a basic Arduino board with ATmega microcontroller from the AVR family, there is BUFFER_LENGTH in Wire.h

The Sparkfun library is probably not compatible with every board. Can you fix that yourself ?
Perhaps you can put this in your sketch: #define I2C_BUFFER_LENGTH BUFFER_LENGTH before including the *.h files.

That define is in MLX90640_I2C_Driver.h already:

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)

//I2C_BUFFER_LENGTH is defined in Wire.H
#define I2C_BUFFER_LENGTH BUFFER_LENGTH

If none of the specified platform matches, the value is set to 32. So an undefined value shouldn't happen except you installed things not correctly. Did you install the *.h and *.cpp file correctly to the library folder?

The Sparkfun library is probably not compatible with every board. Can you fix that yourself ? Perhaps you can put this in your sketch: #define I2C_BUFFER_LENGTH BUFFER_LENGTH before including the *.h files.

Hello Koepel you make my day, that was it! Thank you