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