projects
/
EVA-2020-02-2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated README.rst
[EVA-2020-02-2.git]
/
library
/
enviroplus
/
gas.py
diff --git
a/library/enviroplus/gas.py
b/library/enviroplus/gas.py
index e5fbdd94555edacd32bffb19e81e5508a72d5fd5..ee1ad80b04da340be013215539c20e373fd1c1dd 100644
(file)
--- a/
library/enviroplus/gas.py
+++ b/
library/enviroplus/gas.py
@@
-1,17
+1,17
@@
-"""Read the MICS681
2
via an ads1015 ADC"""
+"""Read the MICS681
4
via an ads1015 ADC"""
import atexit
import ads1015
import RPi.GPIO as GPIO
import atexit
import ads1015
import RPi.GPIO as GPIO
-MICS681
2
_HEATER_PIN = 24
+MICS681
4
_HEATER_PIN = 24
ads1015.I2C_ADDRESS_DEFAULT = ads1015.I2C_ADDRESS_ALTERNATE
_is_setup = False
ads1015.I2C_ADDRESS_DEFAULT = ads1015.I2C_ADDRESS_ALTERNATE
_is_setup = False
-class Mics681
2
Reading(object):
+class Mics681
4
Reading(object):
__slots__ = 'oxidising', 'reducing', 'nh3'
def __init__(self, ox, red, nh3):
__slots__ = 'oxidising', 'reducing', 'nh3'
def __init__(self, ox, red, nh3):
@@
-41,13
+41,13
@@
def setup():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
- GPIO.setup(MICS681
2
_HEATER_PIN, GPIO.OUT)
- GPIO.output(MICS681
2
_HEATER_PIN, 1)
+ GPIO.setup(MICS681
4
_HEATER_PIN, GPIO.OUT)
+ GPIO.output(MICS681
4
_HEATER_PIN, 1)
atexit.register(cleanup)
def cleanup():
atexit.register(cleanup)
def cleanup():
- GPIO.output(MICS681
2
_HEATER_PIN, 0)
+ GPIO.output(MICS681
4
_HEATER_PIN, 0)
def read_all():
def read_all():
@@
-61,7
+61,7
@@
def read_all():
red = (red * 56000) / (3.3 - red)
nh3 = (nh3 * 56000) / (3.3 - nh3)
red = (red * 56000) / (3.3 - red)
nh3 = (nh3 * 56000) / (3.3 - nh3)
- return Mics681
2
Reading(ox, red, nh3)
+ return Mics681
4
Reading(ox, red, nh3)
def read_oxidising():
def read_oxidising():