Add example to demo ADC channel usage
[EVA-2020-02-2.git] / examples / adc.py
CommitLineData
d8a05f16
PH
1#!/usr/bin/env python
2
3import time
4from enviroplus import gas
5
6print("""adc.py - Print readings from the MICS6814 Gas sensor.
7
8Press Ctrl+C to exit!
9
10""")
11
12gas.enable_adc()
13gas.set_adc_gain(4.096)
14
15try:
16 while True:
17 readings = gas.read_all()
18 print(readings)
19 time.sleep(1.0)
20except KeyboardInterrupt:
21 pass