This is the code I am running. It is the example code from the Adafruit DPS310 page:
Code: Select all
import time
import board
import adafruit_dps310
i2c = board.I2C()
dps310 = adafruit_dps310.DPS310(i2c)
while True:
print("Temperature = %.2f *C" % dps310.temperature)
print("Pressure = %.2f hPa" % dps310.pressure)
print("")
time.sleep(1.0)
Traceback (most recent call last):
File "code.py", line 3, in <module>
File "adafruit_dps310.py", line 162, in <module>
File "adafruit_dps310.py", line 256, in DPS310
MemoryError: memory allocation failed, allocating 232 bytes
Running gc.mem_free() before the DPS310 import statement on the third line shows 18,224 bytes free.