projects
/
EVA-2020-02-2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b18dd3
)
Add example to demo ADC channel usage
author
Phil Howard
<phil@gadgetoid.com>
Fri, 12 Jul 2019 12:54:25 +0000
(13:54 +0100)
committer
Phil Howard
<phil@gadgetoid.com>
Fri, 12 Jul 2019 12:54:25 +0000
(13:54 +0100)
examples/adc.py
[new file with mode: 0755]
patch
|
blob
diff --git a/examples/adc.py
b/examples/adc.py
new file mode 100755
(executable)
index 0000000..
c4cf45c
--- /dev/null
+++ b/
examples/adc.py
@@ -0,0
+1,21
@@
+#!/usr/bin/env python
+
+import time
+from enviroplus import gas
+
+print("""adc.py - Print readings from the MICS6814 Gas sensor.
+
+Press Ctrl+C to exit!
+
+""")
+
+gas.enable_adc()
+gas.set_adc_gain(4.096)
+
+try:
+ while True:
+ readings = gas.read_all()
+ print(readings)
+ time.sleep(1.0)
+except KeyboardInterrupt:
+ pass