55`adafruit_scd30`
66================================================================================
77
8- Helper library for the SCD30 e- CO2 sensor
8+ Helper library for the SCD30 CO2 sensor
99
1010
1111* Author(s): Bryan Siepert
1515
1616**Hardware:**
1717
18- * `Adafruit SCD30 Breakout <https://www.adafruit.com/product/48xx >`_
18+ * `Adafruit SCD30 Breakout <https://www.adafruit.com/product/4867 >`_
1919
2020**Software and Dependencies:**
2121
5050
5151
5252class SCD30 :
53- """CircuitPython helper class for using the SCD30 e- CO2 sensor"""
53+ """CircuitPython helper class for using the SCD30 CO2 sensor"""
5454
5555 def __init__ (self , i2c_bus , ambient_pressure = 0 , address = SCD30_DEFAULT_ADDR ):
5656 if ambient_pressure != 0 :
@@ -71,7 +71,7 @@ def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR):
7171 # cached readings
7272 self ._temperature = None
7373 self ._relative_humidity = None
74- self ._e_co2 = None
74+ self ._co2 = None
7575
7676 def reset (self ):
7777 """Perform a soft reset on the sensor, restoring default values"""
@@ -82,7 +82,7 @@ def reset(self):
8282 def measurement_interval (self ):
8383 """Sets the interval between readings in seconds. The interval value must be from 2-1800
8484
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`."""
8686
8787 return self ._read_register (_CMD_SET_MEASUREMENT_INTERVAL )
8888
@@ -101,7 +101,7 @@ def self_calibration_enabled(self):
101101 **NOTE**: Enabling self calibration will override any values set by specifying a
102102 `forced_recalibration_reference`
103103
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`."""
105105
106106 return self ._read_register (_CMD_AUTOMATIC_SELF_CALIBRATION ) == 1
107107
@@ -133,7 +133,7 @@ def altitude(self):
133133 this value adjusts the CO2 measurement calculations to account for the air pressure's effect
134134 on readings.
135135
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`."""
137137 return self ._read_register (_CMD_SET_ALTITUDE_COMPENSATION )
138138
139139 @altitude .setter
@@ -143,10 +143,10 @@ def altitude(self, altitude):
143143 @property
144144 def temperature_offset (self ):
145145 """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
147147 maximum value of 655.35 C
148148
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`."""
150150
151151 raw_offset = self ._read_register (_CMD_SET_TEMPERATURE_OFFSET )
152152 return raw_offset / 100.0
@@ -174,13 +174,13 @@ def forced_recalibration_reference(self, reference_value):
174174 self ._send_command (_CMD_SET_FORCED_RECALIBRATION_FACTOR , reference_value )
175175
176176 @property
177- def eCO2 (self ): # pylint:disable=invalid-name
177+ def CO2 (self ): # pylint:disable=invalid-name
178178 """Returns the CO2 concentration in PPM (parts per million)
179179
180180 **NOTE** Between measurements, the most recent reading will be cached and returned."""
181181 if self .data_available :
182182 self ._read_data ()
183- return self ._e_co2
183+ return self ._co2
184184
185185 @property
186186 def temperature (self ):
@@ -244,7 +244,7 @@ def _read_data(self):
244244 if not crcs_good :
245245 raise RuntimeError ("CRC check failed while reading data" )
246246
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 ]
248248 self ._temperature = unpack (">f" , self ._buffer [6 :8 ] + self ._buffer [9 :11 ])[0 ]
249249 self ._relative_humidity = unpack (
250250 ">f" , self ._buffer [12 :14 ] + self ._buffer [15 :17 ]
0 commit comments