Closed jposada202020 closed 3 years ago
@tannewt please review and comments, and then I wil proceed to all the code cleanup and examples, and references check. I include all the messages for the heap size analysis
Thanks
will do
>>> import bme280_simpletest
Loading only gc 18800
After importing BME280 module 12784
After importing time module 12768
After importing board module 12768
After gc collect 12784
After initiating i2c module 12768
After defining bm280 sensor 8544
After defining sea level pressure 8544
Temperature: 26.3 C
Humidity: 43.2 %
Pressure: 1002.5 hPa
Altitude = 89.93 meters
After print instructions 9728
I decided for maintenability purposes to keep the Variables definitions, that way we could use the functions in both basic and advanced.
before doing test in some boards please review :) Thanks.
I tested this on for the simpletest
and normal_mode
in the examples:
and with the simpletest
on
Ran the test code from the top of this PR (using basic)
Adafruit CircuitPython 7.0.0-alpha.2-705-gc80e25307 on 2021-05-30; Adafruit Feather M0 RFM9x with samd21g18
>>>
>>> import test
Loading only gc 19136
After importing time module 19136
After importing board module 19120
After importing BME280 module 13536
After initiating i2c module 13520
After defining bm280 sensor 12080
After defining sea level pressure 12080
Temperature: 24.3 C
Humidity: 41.3 %
Pressure: 1024.1 hPa
Altitude = -90.18 meters
After print instructions 7632
>>>
I'm not really below sea-level ;-)
Also ran the demo using RFM9x radio and BME280 together-- see #37
@jerryneedell interesting I will take a look at the altitude. Thanks for testing.
I'm not worried about it -- I ddi not set the offset.
This was tested on RP 4 using Pyton 3.7.3 and blinka
Also this was tested on Raspberry Pi Pico with RP2040 Using Blinka and the bme280_simpletest_pico.py
MicroPython v1.15 on 2021-04-18; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
Temperature: 25.8 C
Humidity: 44.6 %
Pressure: 1017.1 hPa
Altitude = -32.61 meters
@tannewt I think we are ready, I will need to modify the learning guide for the library and the Micropython with Blinka learning guide also, as it includes this sensor. If you are ok with the changes I will marge when I do the learning guide changes. Thanks as always
Initial test
Register and Bus_device mpy test code
Test Code
Results
Test 2 Doing a gc before loading the bme280 module
Test 3 trying to load the module from the REPL
Test 4 New module without the I2C and SPI classes
Test 5. Lean Basic file and using mpy file
Test 6 using basic.mpy and Using GC after each print statement