Skip to content

Commit

Permalink
Merge pull request #20 from kattni/fix-up
Browse files Browse the repository at this point in the history
Add version info, update cookie info
  • Loading branch information
ladyada authored Sep 23, 2019
2 parents f1b9e6c + df45c84 commit da222c0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 11 deletions.
30 changes: 25 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,40 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.

Installing from PyPI
=====================
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-bme680/>`_. To install for current user:

.. code-block:: shell
pip3 install adafruit-circuitpython-bme680
To install system-wide (this may be required in some cases):

.. code-block:: shell
sudo pip3 install adafruit-circuitpython-bme680
To install in a virtual environment in your current project:

.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install adafruit-circuitpython-bme680
Usage Example
=============

.. code-block:: python
import gc
from busio import I2C
import adafruit_bme680
import time
import board
gc.collect()
print("Free mem:",gc.mem_free())
# Create library object using our Bus I2C port
i2c = I2C(board.SCL, board.SDA)
bme680 = adafruit_bme680.Adafruit_BME680_I2C(i2c)
Expand Down Expand Up @@ -110,4 +130,4 @@ Now, once you have the virtual environment activated:
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.
locally verify it will pass.
29 changes: 25 additions & 4 deletions adafruit_bme680.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,29 @@
# pylint: disable=too-many-instance-attributes

"""
`adafruit_bme680` - Adafruit BME680 - Temperature, Humidity, Pressure & Gas Sensor
===================================================================================
`adafruit_bme680`
================================================================================
CircuitPython driver from BME680 air quality sensor
CircuitPython library for BME680 temperature, pressure and humidity sensor.
* Author(s): ladyada
* Author(s): Limor Fried
Implementation Notes
--------------------
**Hardware:**
* `Adafruit BME680 Temp, Humidity, Pressure and Gas Sensor <https://www.adafruit.com/product/3660>`_
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
"""


import time
import math
from micropython import const
Expand All @@ -40,6 +55,10 @@
except ImportError:
import ustruct as struct

__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BME680.git"


# I2C ADDRESS/BITS/SETTINGS
# -----------------------------------------------------------------------
_BME680_CHIPID = const(0x61)
Expand Down Expand Up @@ -315,6 +334,7 @@ def _read(self, register, length):
def _write(self, register, values):
raise NotImplementedError()


class Adafruit_BME680_I2C(Adafruit_BME680):
"""Driver for I2C connected BME680.
Expand Down Expand Up @@ -350,6 +370,7 @@ def _write(self, register, values):
if self._debug:
print("\t$%02X <= %s" % (values[0], [hex(i) for i in values[1:]]))


class Adafruit_BME680_SPI(Adafruit_BME680):
"""Driver for SPI connected BME680.
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use_scm_version=True,
setup_requires=['setuptools_scm'],

description='CircuitPython library for controlling a BME680 sensor chip.',
description='CircuitPython library for BME680 temperature, pressure and humidity sensor.',
long_description=long_description,
long_description_content_type='text/x-rst',

Expand Down Expand Up @@ -52,7 +52,8 @@
],

# What does your project relate to?
keywords='adafruit bme680 hardware micropython circuitpython',
keywords='adafruit blinka circuitpython micropython bme680 hardware temperature pressure '
'humidity gas',

# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
Expand Down

0 comments on commit da222c0

Please sign in to comment.