adafruit / Adafruit_Si7021

Arduino library for Adafruit Si7021
34 stars 28 forks source link

RAM leak in library 1.5.1 #27

Closed Zangetsu71 closed 2 years ago

Zangetsu71 commented 2 years ago

[Adafruit_Si7021_Library@1.4.0] / [Adafruit_Si7021_Library@1.5.1]

all other libraries are in the zip file.

Polling the sensor(humidity or temperature) eats 8 bytes of RAM each poll that doesn't get released each loop. This will cause the program to crash in a few minutes (out of RAM)

Using Adafruit version (of the Si7021) 1.4.0 fixes the RAM leak problem, the problem exist with version 1.5.0 and 1.5.1.

code also in zip, as it is unreadable as text here ( brackets don't seem to work very well with my code?)

caternuson commented 2 years ago

Try changing how you are creating the sensor instance. Don't #def it:

#define Si7021_sensor Adafruit_Si7021()

Use the syntax from the library example instead:

Adafruit_Si7021 sensor = Adafruit_Si7021();
Zangetsu71 commented 2 years ago

Using above fix, fixes the RAM problem. ty for the fast response.