Remove .travis.yml
[EVA-2020-02-2.git] / examples / adc.py
... / ...
CommitLineData
1#!/usr/bin/env python3
2
3import time
4from enviroplus import gas
5import logging
6
7logging.basicConfig(
8 format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s',
9 level=logging.INFO,
10 datefmt='%Y-%m-%d %H:%M:%S')
11
12logging.info("""adc.py - Print readings from the MICS6814 Gas sensor.
13
14Press Ctrl+C to exit!
15
16""")
17
18gas.enable_adc()
19gas.set_adc_gain(4.096)
20
21try:
22 while True:
23 readings = gas.read_all()
24 logging.info(readings)
25 time.sleep(1.0)
26except KeyboardInterrupt:
27 pass