Added example
This commit is contained in:
14
example.py
Normal file
14
example.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from smbus2 import SMBus
|
||||||
|
from sgp30 import SGP30
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
bus = SMBus(1)
|
||||||
|
sensor = SGP30(bus)
|
||||||
|
print(sensor.read_features())
|
||||||
|
print(sensor.read_serial())
|
||||||
|
sensor.init_sgp()
|
||||||
|
for i in range(300):
|
||||||
|
print(sensor.read_measurements())
|
||||||
|
time.sleep(0.1)
|
||||||
|
sensor.store_baseline()
|
||||||
|
bus.close()
|
Reference in New Issue
Block a user