5
5
`adafruit_scd30`
6
6
================================================================================
7
7
8
- Helper library for the SCD30 e- CO2 sensor
8
+ Helper library for the SCD30 CO2 sensor
9
9
10
10
11
11
* Author(s): Bryan Siepert
15
15
16
16
**Hardware:**
17
17
18
- * `Adafruit SCD30 Breakout <https://www.adafruit.com/product/48xx >`_
18
+ * `Adafruit SCD30 Breakout <https://www.adafruit.com/product/4867 >`_
19
19
20
20
**Software and Dependencies:**
21
21
50
50
51
51
52
52
class SCD30 :
53
- """CircuitPython helper class for using the SCD30 e- CO2 sensor"""
53
+ """CircuitPython helper class for using the SCD30 CO2 sensor"""
54
54
55
55
def __init__ (self , i2c_bus , ambient_pressure = 0 , address = SCD30_DEFAULT_ADDR ):
56
56
if ambient_pressure != 0 :
@@ -71,7 +71,7 @@ def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR):
71
71
# cached readings
72
72
self ._temperature = None
73
73
self ._relative_humidity = None
74
- self ._e_co2 = None
74
+ self ._co2 = None
75
75
76
76
def reset (self ):
77
77
"""Perform a soft reset on the sensor, restoring default values"""
@@ -82,7 +82,7 @@ def reset(self):
82
82
def measurement_interval (self ):
83
83
"""Sets the interval between readings in seconds. The interval value must be from 2-1800
84
84
85
- **NOTE** This value will be saved and will not be reset on boot or by callint `reset`."""
85
+ **NOTE** This value will be saved and will not be reset on boot or by calling `reset`."""
86
86
87
87
return self ._read_register (_CMD_SET_MEASUREMENT_INTERVAL )
88
88
@@ -101,7 +101,7 @@ def self_calibration_enabled(self):
101
101
**NOTE**: Enabling self calibration will override any values set by specifying a
102
102
`forced_recalibration_reference`
103
103
104
- **NOTE** This setting will be saved and will not be reset on boot or by callint `reset`."""
104
+ **NOTE** This setting will be saved and will not be reset on boot or by calling `reset`."""
105
105
106
106
return self ._read_register (_CMD_AUTOMATIC_SELF_CALIBRATION ) == 1
107
107
@@ -133,7 +133,7 @@ def altitude(self):
133
133
this value adjusts the CO2 measurement calculations to account for the air pressure's effect
134
134
on readings.
135
135
136
- **NOTE** This value will be stored and will not be reset on boot or by callint `reset`."""
136
+ **NOTE** This value will be stored and will not be reset on boot or by calling `reset`."""
137
137
return self ._read_register (_CMD_SET_ALTITUDE_COMPENSATION )
138
138
139
139
@altitude .setter
@@ -143,10 +143,10 @@ def altitude(self, altitude):
143
143
@property
144
144
def temperature_offset (self ):
145
145
"""Specifies the offset to be added to the reported measurements to account for a bias in
146
- the measured signal. Value is in degrees Celcius with a resolution of 0.01 degrees and a
146
+ the measured signal. Value is in degrees Celsius with a resolution of 0.01 degrees and a
147
147
maximum value of 655.35 C
148
148
149
- **NOTE** This value will be saved and will not be reset on boot or by callint `reset`."""
149
+ **NOTE** This value will be saved and will not be reset on boot or by calling `reset`."""
150
150
151
151
raw_offset = self ._read_register (_CMD_SET_TEMPERATURE_OFFSET )
152
152
return raw_offset / 100.0
@@ -174,13 +174,13 @@ def forced_recalibration_reference(self, reference_value):
174
174
self ._send_command (_CMD_SET_FORCED_RECALIBRATION_FACTOR , reference_value )
175
175
176
176
@property
177
- def eCO2 (self ): # pylint:disable=invalid-name
177
+ def CO2 (self ): # pylint:disable=invalid-name
178
178
"""Returns the CO2 concentration in PPM (parts per million)
179
179
180
180
**NOTE** Between measurements, the most recent reading will be cached and returned."""
181
181
if self .data_available :
182
182
self ._read_data ()
183
- return self ._e_co2
183
+ return self ._co2
184
184
185
185
@property
186
186
def temperature (self ):
@@ -244,7 +244,7 @@ def _read_data(self):
244
244
if not crcs_good :
245
245
raise RuntimeError ("CRC check failed while reading data" )
246
246
247
- self ._e_co2 = unpack (">f" , self ._buffer [0 :2 ] + self ._buffer [3 :5 ])[0 ]
247
+ self ._co2 = unpack (">f" , self ._buffer [0 :2 ] + self ._buffer [3 :5 ])[0 ]
248
248
self ._temperature = unpack (">f" , self ._buffer [6 :8 ] + self ._buffer [9 :11 ])[0 ]
249
249
self ._relative_humidity = unpack (
250
250
">f" , self ._buffer [12 :14 ] + self ._buffer [15 :17 ]
0 commit comments