File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,32 @@ This is easily achieved by downloading
26
26
Usage Example
27
27
=============
28
28
29
- TODO
29
+ .. code-block :: python
30
+ import gc
31
+ from busio import I2C
32
+ import adafruit_bme680
33
+ import time
34
+ import board
35
+
36
+ gc.collect()
37
+ print (" Free mem:" ,gc.mem_free())
38
+
39
+ # Create library object using our Bus I2C port
40
+ i2c = I2C(board.SCL , board.SDA )
41
+ bme280 = adafruit_bme680.Adafruit_BME680_I2C(i2c)
42
+
43
+ # change this to match the location's pressure (hPa) at sea level
44
+ bme280.seaLevelhPa = 1013.25
45
+
46
+ while True :
47
+ print (" \n Temperature: %0.1f C" % bme280.temperature)
48
+ print (" Gas: %d ohm" % bme280.gas)
49
+ print (" Humidity: %0.1f %% " % bme280.humidity)
50
+ print (" Pressure: %0.1f hPa" % bme280.pressure)
51
+ print (" Altitude = %0.2f meters" % bme280.altitude)
52
+
53
+ time.sleep(2 )
54
+
30
55
31
56
Contributing
32
57
============
You can’t perform that action at this time.
0 commit comments