Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eCO2 -> CO2 #5

Merged
merged 4 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Introduction
:target: https://github.com/psf/black
:alt: Code Style: Black

Helper library for the SCD30 e-CO2 sensor
Helper library for the SCD30 CO2 sensor


Dependencies
Expand Down Expand Up @@ -75,7 +75,7 @@ Usage Example
# the values, to ensure current readings.
if scd.data_available:
print("Data Available!")
print("eCO2:", scd.eCO2, "PPM")
print("CO2:", scd.CO2, "PPM")
print("Temperature:", scd.temperature, "degrees C")
print("Humidity:", scd.relative_humidity, "%%rH")
print("")
Expand Down
24 changes: 12 additions & 12 deletions adafruit_scd30.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`adafruit_scd30`
================================================================================

Helper library for the SCD30 e-CO2 sensor
Helper library for the SCD30 CO2 sensor


* Author(s): Bryan Siepert
Expand All @@ -15,7 +15,7 @@

**Hardware:**

* `Adafruit SCD30 Breakout <https://www.adafruit.com/product/48xx>`_
* `Adafruit SCD30 Breakout <https://www.adafruit.com/product/4867>`_

**Software and Dependencies:**

Expand Down Expand Up @@ -50,7 +50,7 @@


class SCD30:
"""CircuitPython helper class for using the SCD30 e-CO2 sensor"""
"""CircuitPython helper class for using the SCD30 CO2 sensor"""

def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR):
if ambient_pressure != 0:
Expand All @@ -71,7 +71,7 @@ def __init__(self, i2c_bus, ambient_pressure=0, address=SCD30_DEFAULT_ADDR):
# cached readings
self._temperature = None
self._relative_humidity = None
self._e_co2 = None
self._co2 = None

def reset(self):
"""Perform a soft reset on the sensor, restoring default values"""
Expand All @@ -82,7 +82,7 @@ def reset(self):
def measurement_interval(self):
"""Sets the interval between readings in seconds. The interval value must be from 2-1800

**NOTE** This value will be saved and will not be reset on boot or by callint `reset`."""
**NOTE** This value will be saved and will not be reset on boot or by calling `reset`."""

return self._read_register(_CMD_SET_MEASUREMENT_INTERVAL)

Expand All @@ -101,7 +101,7 @@ def self_calibration_enabled(self):
**NOTE**: Enabling self calibration will override any values set by specifying a
`forced_recalibration_reference`

**NOTE** This setting will be saved and will not be reset on boot or by callint `reset`."""
**NOTE** This setting will be saved and will not be reset on boot or by calling `reset`."""

return self._read_register(_CMD_AUTOMATIC_SELF_CALIBRATION) == 1

Expand Down Expand Up @@ -133,7 +133,7 @@ def altitude(self):
this value adjusts the CO2 measurement calculations to account for the air pressure's effect
on readings.

**NOTE** This value will be stored and will not be reset on boot or by callint `reset`."""
**NOTE** This value will be stored and will not be reset on boot or by calling `reset`."""
return self._read_register(_CMD_SET_ALTITUDE_COMPENSATION)

@altitude.setter
Expand All @@ -143,10 +143,10 @@ def altitude(self, altitude):
@property
def temperature_offset(self):
"""Specifies the offset to be added to the reported measurements to account for a bias in
the measured signal. Value is in degrees Celcius with a resolution of 0.01 degrees and a
the measured signal. Value is in degrees Celsius with a resolution of 0.01 degrees and a
maximum value of 655.35 C

**NOTE** This value will be saved and will not be reset on boot or by callint `reset`."""
**NOTE** This value will be saved and will not be reset on boot or by calling `reset`."""

raw_offset = self._read_register(_CMD_SET_TEMPERATURE_OFFSET)
return raw_offset / 100.0
Expand Down Expand Up @@ -174,13 +174,13 @@ def forced_recalibration_reference(self, reference_value):
self._send_command(_CMD_SET_FORCED_RECALIBRATION_FACTOR, reference_value)

@property
def eCO2(self): # pylint:disable=invalid-name
def CO2(self): # pylint:disable=invalid-name
"""Returns the CO2 concentration in PPM (parts per million)

**NOTE** Between measurements, the most recent reading will be cached and returned."""
if self.data_available:
self._read_data()
return self._e_co2
return self._co2

@property
def temperature(self):
Expand Down Expand Up @@ -244,7 +244,7 @@ def _read_data(self):
if not crcs_good:
raise RuntimeError("CRC check failed while reading data")

self._e_co2 = unpack(">f", self._buffer[0:2] + self._buffer[3:5])[0]
self._co2 = unpack(">f", self._buffer[0:2] + self._buffer[3:5])[0]
self._temperature = unpack(">f", self._buffer[6:8] + self._buffer[9:11])[0]
self._relative_humidity = unpack(
">f", self._buffer[12:14] + self._buffer[15:17]
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Experiment with different tuning parameters and settings

.. literalinclude:: ../examples/scd30_tuning_knobs.py
:caption: examples/scd30_tuning_knobs.py
:linenos:
:linenos:
2 changes: 1 addition & 1 deletion examples/scd30_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# the values, to ensure current readings.
if scd.data_available:
print("Data Available!")
print("eCO2:", scd.eCO2, "PPM")
print("CO2:", scd.CO2, "PPM")
print("Temperature:", scd.temperature, "degrees C")
print("Humidity:", scd.relative_humidity, "%%rH")
print("")
Expand Down
2 changes: 1 addition & 1 deletion examples/scd30_tuning_knobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
data = scd.data_available
if data:
print("Data Available!")
print("eCO2:", scd.eCO2, "PPM")
print("CO2:", scd.CO2, "PPM")
print("Temperature:", scd.temperature, "degrees C")
print("Humidity::", scd.relative_humidity, "%%rH")
print("")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
name="adafruit-circuitpython-scd30",
use_scm_version=True,
setup_requires=["setuptools_scm"],
description="Helper library for the SCD30 e-CO2 sensor",
description="Helper library for the SCD30 CO2 sensor",
long_description=long_description,
long_description_content_type="text/x-rst",
# The project's main homepage.
Expand Down