Commit | Line | Data |
---|---|---|
0cf10e5b PH |
1 | #!/usr/bin/env python |
2 | ||
3 | import time | |
8ab4cd2d | 4 | from enviroplus import gas |
0cf10e5b PH |
5 | |
6 | ||
7 | print("""gas.py - Print readings from the MICS6812 Gas sensor. | |
8 | ||
9 | Press Ctrl+C to exit! | |
8ab4cd2d | 10 | |
0cf10e5b PH |
11 | """) |
12 | ||
13 | try: | |
14 | while True: | |
15 | readings = gas.read_all() | |
16 | print(readings) | |
17 | time.sleep(1.0) | |
18 | except KeyboardInterrupt: | |
19 | pass |