Compare commits

..

No commits in common. "master" and "pypi-readme-update" have entirely different histories.

12 changed files with 268 additions and 676 deletions

View file

@ -1,57 +0,0 @@
name: Build CI
on: [pull_request, push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Translate Repo Name For Build Tools filename_prefix
id: repo-name
run: |
echo ::set-output name=repo-name::$(
echo ${{ github.repository }} |
awk -F '\/' '{ print tolower($2) }' |
tr '_' '-'
)
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Versions
run: |
python3 --version
- name: Checkout Current Repo
uses: actions/checkout@v1
with:
submodules: true
- name: Checkout tools repo
uses: actions/checkout@v2
with:
repository: adafruit/actions-ci-circuitpython-libs
path: actions-ci
- name: Install dependencies
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
run: |
source actions-ci/install.sh
- name: Pip install pylint, black, & Sphinx
run: |
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
- name: Library version
run: git describe --dirty --always --tags
- name: Check formatting
run: |
black --check --target-version=py35 .
- name: PyLint
run: |
pylint $( find . -path './adafruit*.py' )
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
- name: Build assets
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
- name: Build docs
working-directory: docs
run: sphinx-build -E -W -b html . _build/html

View file

@ -1,81 +0,0 @@
name: Release Actions
on:
release:
types: [published]
jobs:
upload-release-assets:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Translate Repo Name For Build Tools filename_prefix
id: repo-name
run: |
echo ::set-output name=repo-name::$(
echo ${{ github.repository }} |
awk -F '\/' '{ print tolower($2) }' |
tr '_' '-'
)
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Versions
run: |
python3 --version
- name: Checkout Current Repo
uses: actions/checkout@v1
with:
submodules: true
- name: Checkout tools repo
uses: actions/checkout@v2
with:
repository: adafruit/actions-ci-circuitpython-libs
path: actions-ci
- name: Install deps
run: |
source actions-ci/install.sh
- name: Build assets
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
- name: Upload Release Assets
# the 'official' actions version does not yet support dynamically
# supplying asset names to upload. @csexton's version chosen based on
# discussion in the issue below, as its the simplest to implement and
# allows for selecting files with a pattern.
# https://github.com/actions/upload-release-asset/issues/4
#uses: actions/upload-release-asset@v1.0.1
uses: csexton/release-asset-action@master
with:
pattern: "bundles/*"
github-token: ${{ secrets.GITHUB_TOKEN }}
upload-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check For setup.py
id: need-pypi
run: |
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
- name: Set up Python
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
python setup.py sdist
twine upload dist/*

1
.gitignore vendored
View file

@ -4,6 +4,7 @@ __pycache__
_build
*.pyc
.env
build*
bundles
*.DS_Store
.eggs

View file

@ -52,7 +52,7 @@ confidence=
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
@ -119,8 +119,7 @@ spelling-store-unknown-words=no
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
# notes=FIXME,XXX,TODO
notes=FIXME,XXX
notes=FIXME,XXX,TODO
[TYPECHECK]

31
.travis.yml Normal file
View file

@ -0,0 +1,31 @@
dist: trusty
sudo: false
language: python
python:
- '3.6'
cache:
pip: true
deploy:
- provider: releases
api_key: "$GITHUB_TOKEN"
file_glob: true
file: "$TRAVIS_BUILD_DIR/bundles/*"
skip_cleanup: true
overwrite: true
on:
tags: true
- provider: pypi
user: adafruit-travis
on:
tags: true
password:
secure: cWI6Vmsiauq17r4eKeJWyIJkKi//J5aBcwZB76Dx099overDtUAl352Keg4tfsw9k9C8G2jWMhYTiR0vzv85k5th6aFw/5M1HHz5N/rDcAIQwCGwkwkiBbdRXk4UNKx1PNep1cUZl9oiO/34mowDnESYMOqQ8bEL9loRK61IjwKsUbx5uaivuISw9haFu1yhRs7GR4/9vF5rkn7Jof/rDfE2P52sopdim2sU6U49jvgl3XS1f4hPbHaEEkZi5bKVR81UV45oI/KnOXpRo4beR+1fts4GtkzEYDrJU/jBglVdqDcDfafs3jp20+6l2ngUfIZTg718JSs7F4MqjV/aATFlNiWYLxCEpdS/Y4k3SaaljzI1IznjPTUvrpYkCpSwMuzxDFpXUVXVUfYX7CqIF+UYa1gmPW44ieahCz7C7BBs6FA6CwVH64uQ57mNJLxrFXbQByQ+S1dGeGgdbF5juxGVr6P+nCkc7lwumixkeJULnC7AMyI7nP9yxj22u+UYuvL6VQncix+b/bNJzesFXpOfM9laSBhrjQEKDt9zQDk6dN+kFbZhCQfouYXf1/P5K+UxiYPOqqPpHfxkhCux15uMcnpFgjK40ACMOnSOU0dLVc7X6vK1kNeKBWQvuZcXAzXSvVTlCFs4ftxofnmoxzfFEySKLICCPZpc6ZjilDM=
install:
- pip install -r requirements.txt
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
- pip install --force-reinstall pylint==1.9.2
script:
- pylint adafruit_bmp280.py
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py)
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bmp280 --library_location .
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

View file

@ -1,129 +1,74 @@
# Adafruit Community Code of Conduct
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and leaders pledge to making participation in our project and
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level or type of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
We are committed to providing a friendly, safe and welcoming environment for
all.
Examples of behavior that contributes to creating a positive environment
include:
* Be kind and courteous to others
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Collaborating with other community members
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and sexual attention or advances
* The use of inappropriate images, including in a community member's avatar
* The use of inappropriate language, including in a community member's nickname
* Any spamming, flaming, baiting or other attention-stealing behavior
* Excessive or unwelcome helping; answering outside the scope of the question
asked
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Promoting or spreading disinformation, lies, or conspiracy theories against
a person, group, organisation, project, or community
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate
The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you dont just aim to be
"technically unimpeachable", but rather try to be your best self.
We value many things beyond technical expertise, including collaboration and
supporting others within our community. Providing a positive experience for
other community members can have a much more significant impact than simply
providing the correct answer.
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project leaders are responsible for clarifying the standards of acceptable
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project leaders have the right and responsibility to remove, edit, or
reject messages, comments, commits, code, issues, and other contributions
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any community member for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.
## Moderation
Instances of behaviors that violate the Adafruit Community Code of Conduct
may be reported by any member of the community. Community members are
encouraged to report these situations, including situations they witness
involving other community members.
You may report in the following ways:
In any situation, you may send an email to <support@adafruit.com>.
On the Adafruit Discord, you may send an open message from any channel
to all Community Moderators by tagging @community moderators. You may
also send an open message from any channel, or a direct message to
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
Email and direct message reports will be kept confidential.
In situations on Discord where the issue is particularly egregious, possibly
illegal, requires immediate action, or violates the Discord terms of service,
you should also report the message directly to Discord.
These are the steps for upholding our communitys standards of conduct.
1. Any member of the community may report any situation that violates the
Adafruit Community Code of Conduct. All reports will be reviewed and
investigated.
2. If the behavior is an egregious violation, the community member who
committed the violation may be banned immediately, without warning.
3. Otherwise, moderators will first respond to such behavior with a warning.
4. Moderators follow a soft "three strikes" policy - the community member may
be given another chance, if they are receptive to the warning and change their
behavior.
5. If the community member is unreceptive or unreasonable when warned by a
moderator, or the warning goes unheeded, they may be banned for a first or
second offense. Repeated offenses will result in the community member being
banned.
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct and the enforcement policies listed above apply to all
Adafruit Community venues. This includes but is not limited to any community
spaces (both public and private), the entire Adafruit Discord server, and
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
interaction at a conference.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. As a community
member, you are representing our community, and are expected to behave
accordingly.
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at support@adafruit.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
For other projects adopting the Adafruit Community Code of
Conduct, please contact the maintainers of those projects for enforcement.
If you wish to use this code of conduct for your own project, consider
explicitly mentioning your moderation policy or making a copy with your
own moderation policy so as to avoid confusion.
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View file

@ -6,11 +6,11 @@ Introduction
:alt: Documentation Status
.. image :: https://img.shields.io/discord/327254708534116352.svg
:target: https://adafru.it/discord
:target: https://discord.gg/nBQh6qu
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BMP280/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_BMP280/actions/
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_BMP280.svg?branch=master
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_BMP280
:alt: Build Status
CircuitPython driver from BMP280 Temperature and Barometic Pressure sensor
@ -58,23 +58,23 @@ Usage Example
.. code-block:: python
import time
import board
# import digitalio # For use with SPI
import digitalio
import busio
import adafruit_bmp280
import time
from adafruit_bmp280 import adafruit_bmp280
# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
# OR create library object using our Bus SPI port
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# bmp_cs = digitalio.DigitalInOut(board.D10)
# bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)
#spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
#bmp_cs = digitalio.DigitalInOut(board.D10)
#bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)
# change this to match the location's pressure (hPa) at sea level
bmp280.sea_level_pressure = 1013.25
bmp280.seaLevelhPa = 1013.25
while True:
print("\nTemperature: %0.1f C" % bmp280.temperature)
@ -89,8 +89,49 @@ Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_bmp280/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Documentation
=============
Building locally
================
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.Travis will. This is a good way to
To build this library locally you'll need to install the
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
.. code-block:: shell
python3 -m venv .env
source .env/bin/activate
pip install circuitpython-build-tools
Once installed, make sure you are in the virtual environment:
.. code-block:: shell
source .env/bin/activate
Then run the build:
.. code-block:: shell
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bmp280 --library_location .
Sphinx documentation
-----------------------
Sphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):
.. code-block:: shell
python3 -m venv .env
source .env/bin/activate
pip install Sphinx sphinx-rtd-theme
Now, once you have the virtual environment activated:
.. code-block:: shell
cd docs
sphinx-build -E -W -b html . _build/html
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.

View file

@ -20,20 +20,20 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
`adafruit_bmp280` - Adafruit BMP280 - Temperature & Barometic Pressure Sensor
===============================================================================
`adafruit_bmp280`
====================================================
CircuitPython driver from BMP280 Temperature and Barometic Pressure sensor
* Author(s): ladyada
"""
import math
from time import sleep
import time
try:
import struct
except ImportError:
import ustruct as struct
from micropython import const
__version__ = "0.0.0-auto.0"
@ -45,324 +45,96 @@ _CHIP_ID = const(0x58)
_REGISTER_CHIPID = const(0xD0)
_REGISTER_DIG_T1 = const(0x88)
# _REGISTER_DIG_T2 = const(0x8A)
# _REGISTER_DIG_T3 = const(0x8C)
# _REGISTER_DIG_P1 = const(0x8E)
# _REGISTER_DIG_P2 = const(0x90)
# _REGISTER_DIG_P3 = const(0x92)
# _REGISTER_DIG_P4 = const(0x94)
# _REGISTER_DIG_P5 = const(0x96)
# _REGISTER_DIG_P6 = const(0x98)
# _REGISTER_DIG_P7 = const(0x9A)
# _REGISTER_DIG_P8 = const(0x9C)
# _REGISTER_DIG_P9 = const(0x9E)
_REGISTER_SOFTRESET = const(0xE0)
_REGISTER_STATUS = const(0xF3)
_REGISTER_CTRL_MEAS = const(0xF4)
_REGISTER_CONTROL = const(0xF4)
_REGISTER_CONFIG = const(0xF5)
_REGISTER_PRESSUREDATA = const(0xF7)
_REGISTER_TEMPDATA = const(0xFA)
_BMP280_PRESSURE_MIN_HPA = const(300)
_BMP280_PRESSURE_MAX_HPA = const(1100)
"""iir_filter values"""
IIR_FILTER_DISABLE = const(0)
IIR_FILTER_X2 = const(0x01)
IIR_FILTER_X4 = const(0x02)
IIR_FILTER_X8 = const(0x03)
IIR_FILTER_X16 = const(0x04)
_BMP280_IIR_FILTERS = (
IIR_FILTER_DISABLE,
IIR_FILTER_X2,
IIR_FILTER_X4,
IIR_FILTER_X8,
IIR_FILTER_X16,
)
"""overscan values for temperature, pressure, and humidity"""
OVERSCAN_DISABLE = const(0x00)
OVERSCAN_X1 = const(0x01)
OVERSCAN_X2 = const(0x02)
OVERSCAN_X4 = const(0x03)
OVERSCAN_X8 = const(0x04)
OVERSCAN_X16 = const(0x05)
_BMP280_OVERSCANS = {
OVERSCAN_DISABLE: 0,
OVERSCAN_X1: 1,
OVERSCAN_X2: 2,
OVERSCAN_X4: 4,
OVERSCAN_X8: 8,
OVERSCAN_X16: 16,
}
"""mode values"""
MODE_SLEEP = const(0x00)
MODE_FORCE = const(0x01)
MODE_NORMAL = const(0x03)
_BMP280_MODES = (MODE_SLEEP, MODE_FORCE, MODE_NORMAL)
"""
standby timeconstant values
TC_X[_Y] where X=milliseconds and Y=tenths of a millisecond
"""
STANDBY_TC_0_5 = const(0x00) # 0.5ms
STANDBY_TC_10 = const(0x06) # 10ms
STANDBY_TC_20 = const(0x07) # 20ms
STANDBY_TC_62_5 = const(0x01) # 62.5ms
STANDBY_TC_125 = const(0x02) # 125ms
STANDBY_TC_250 = const(0x03) # 250ms
STANDBY_TC_500 = const(0x04) # 500ms
STANDBY_TC_1000 = const(0x05) # 1000ms
_BMP280_STANDBY_TCS = (
STANDBY_TC_0_5,
STANDBY_TC_10,
STANDBY_TC_20,
STANDBY_TC_62_5,
STANDBY_TC_125,
STANDBY_TC_250,
STANDBY_TC_500,
STANDBY_TC_1000,
)
class Adafruit_BMP280: # pylint: disable=invalid-name
class Adafruit_BMP280: # pylint: disable=invalid-name
"""Base BMP280 object. Use `Adafruit_BMP280_I2C` or `Adafruit_BMP280_SPI` instead of this. This
checks the BMP280 was found, reads the coefficients and enables the sensor for continuous
reads"""
def __init__(self):
# Check device ID.
chip_id = self._read_byte(_REGISTER_CHIPID)
if _CHIP_ID != chip_id:
raise RuntimeError("Failed to find BMP280! Chip ID 0x%x" % chip_id)
# Set some reasonable defaults.
self._iir_filter = IIR_FILTER_DISABLE
self._overscan_temperature = OVERSCAN_X2
self._overscan_pressure = OVERSCAN_X16
self._t_standby = STANDBY_TC_0_5
self._mode = MODE_SLEEP
self._reset()
raise RuntimeError('Failed to find BMP280! Chip ID 0x%x' % chip_id)
self._read_coefficients()
self._write_ctrl_meas()
self._write_config()
self.sea_level_pressure = 1013.25
"""Pressure in hectoPascals at sea level. Used to calibrate `altitude`."""
self._t_fine = None
def _read_temperature(self):
# perform one measurement
if self.mode != MODE_NORMAL:
self.mode = MODE_FORCE
# Wait for conversion to complete
while self._get_status() & 0x08:
sleep(0.002)
raw_temperature = (
self._read24(_REGISTER_TEMPDATA) / 16
) # lowest 4 bits get dropped
# print("raw temp: ", UT)
var1 = (
raw_temperature / 16384.0 - self._temp_calib[0] / 1024.0
) * self._temp_calib[1]
# print(var1)
var2 = (
(raw_temperature / 131072.0 - self._temp_calib[0] / 8192.0)
* (raw_temperature / 131072.0 - self._temp_calib[0] / 8192.0)
) * self._temp_calib[2]
# print(var2)
def _read(self):
"""Returns a tuple for temperature and pressure."""
# perform one measurement in high res, forced mode
self._write_register_byte(_REGISTER_CONTROL, 0xFE)
self._t_fine = int(var1 + var2)
# print("t_fine: ", self.t_fine)
# Wait for conversion to complete
while self._read_byte(_REGISTER_STATUS) & 0x08:
time.sleep(0.002)
# lowest 4 bits get dropped
UT = self._read24(_REGISTER_TEMPDATA) / 16
#print("raw temp: ", UT)
def _reset(self):
"""Soft reset the sensor"""
self._write_register_byte(_REGISTER_SOFTRESET, 0xB6)
sleep(0.004) # Datasheet says 2ms. Using 4ms just to be safe
var1 = (UT / 16384.0 - self._temp_calib[0] / 1024.0) * self._temp_calib[1]
var2 = ((UT / 131072.0 - self._temp_calib[0] / 8192.0) * (
UT / 131072.0 - self._temp_calib[0] / 8192.0)) * self._temp_calib[2]
#print("t_fine: ", self.t_fine)
t_fine = int(var1 + var2)
temperature = t_fine / 5120.0
def _write_ctrl_meas(self):
"""
Write the values to the ctrl_meas register in the device
ctrl_meas sets the pressure and temperature data acquistion options
"""
self._write_register_byte(_REGISTER_CTRL_MEAS, self._ctrl_meas)
def _get_status(self):
"""Get the value from the status register in the device """
return self._read_byte(_REGISTER_STATUS)
def _read_config(self):
"""Read the value from the config register in the device """
return self._read_byte(_REGISTER_CONFIG)
def _write_config(self):
"""Write the value to the config register in the device """
normal_flag = False
if self._mode == MODE_NORMAL:
# Writes to the config register may be ignored while in Normal mode
normal_flag = True
self.mode = MODE_SLEEP # So we switch to Sleep mode first
self._write_register_byte(_REGISTER_CONFIG, self._config)
if normal_flag:
self.mode = MODE_NORMAL
@property
def mode(self):
"""
Operation mode
Allowed values are set in the MODE enum class
"""
return self._mode
@mode.setter
def mode(self, value):
if not value in _BMP280_MODES:
raise ValueError("Mode '%s' not supported" % (value))
self._mode = value
self._write_ctrl_meas()
@property
def standby_period(self):
"""
Control the inactive period when in Normal mode
Allowed standby periods are set the STANDBY enum class
"""
return self._t_standby
@standby_period.setter
def standby_period(self, value):
if not value in _BMP280_STANDBY_TCS:
raise ValueError("Standby Period '%s' not supported" % (value))
if self._t_standby == value:
return
self._t_standby = value
self._write_config()
@property
def overscan_temperature(self):
"""
Temperature Oversampling
Allowed values are set in the OVERSCAN enum class
"""
return self._overscan_temperature
@overscan_temperature.setter
def overscan_temperature(self, value):
if not value in _BMP280_OVERSCANS:
raise ValueError("Overscan value '%s' not supported" % (value))
self._overscan_temperature = value
self._write_ctrl_meas()
@property
def overscan_pressure(self):
"""
Pressure Oversampling
Allowed values are set in the OVERSCAN enum class
"""
return self._overscan_pressure
@overscan_pressure.setter
def overscan_pressure(self, value):
if not value in _BMP280_OVERSCANS:
raise ValueError("Overscan value '%s' not supported" % (value))
self._overscan_pressure = value
self._write_ctrl_meas()
@property
def iir_filter(self):
"""
Controls the time constant of the IIR filter
Allowed values are set in the IIR_FILTER enum class
"""
return self._iir_filter
@iir_filter.setter
def iir_filter(self, value):
if not value in _BMP280_IIR_FILTERS:
raise ValueError("IIR Filter '%s' not supported" % (value))
self._iir_filter = value
self._write_config()
@property
def _config(self):
"""Value to be written to the device's config register """
config = 0
if self.mode == MODE_NORMAL:
config += self._t_standby << 5
if self._iir_filter:
config += self._iir_filter << 2
return config
@property
def _ctrl_meas(self):
"""Value to be written to the device's ctrl_meas register """
ctrl_meas = self.overscan_temperature << 5
ctrl_meas += self.overscan_pressure << 2
ctrl_meas += self.mode
return ctrl_meas
@property
def measurement_time_typical(self):
"""Typical time in milliseconds required to complete a measurement in normal mode"""
meas_time_ms = 1
if self.overscan_temperature != OVERSCAN_DISABLE:
meas_time_ms += 2 * _BMP280_OVERSCANS.get(self.overscan_temperature)
if self.overscan_pressure != OVERSCAN_DISABLE:
meas_time_ms += 2 * _BMP280_OVERSCANS.get(self.overscan_pressure) + 0.5
return meas_time_ms
@property
def measurement_time_max(self):
"""Maximum time in milliseconds required to complete a measurement in normal mode"""
meas_time_ms = 1.25
if self.overscan_temperature != OVERSCAN_DISABLE:
meas_time_ms += 2.3 * _BMP280_OVERSCANS.get(self.overscan_temperature)
if self.overscan_pressure != OVERSCAN_DISABLE:
meas_time_ms += 2.3 * _BMP280_OVERSCANS.get(self.overscan_pressure) + 0.575
return meas_time_ms
adc = self._read24(_REGISTER_PRESSUREDATA) / 16
var1 = float(t_fine) / 2.0 - 64000.0
var2 = var1 * var1 * self._pressure_calib[5] / 32768.0
var2 = var2 + var1 * self._pressure_calib[4] * 2.0
var2 = var2 / 4.0 + self._pressure_calib[3] * 65536.0
var1 = (self._pressure_calib[2] * var1 * var1 / 524288.0 +
self._pressure_calib[1] * var1) / 524288.0
var1 = (1.0 + var1 / 32768.0) * self._pressure_calib[0]
if var1 == 0:
return 0
p = 1048576.0 - adc
p = ((p - var2 / 4096.0) * 6250.0) / var1
var1 = self._pressure_calib[8] * p * p / 2147483648.0
var2 = p * self._pressure_calib[7] / 32768.0
p = p + (var1 + var2 + self._pressure_calib[6]) / 16.0
pressure = p / 100
return (temperature, pressure)
@property
def temperature(self):
"""The compensated temperature in degrees celsius."""
self._read_temperature()
return self._t_fine / 5120.0
return self._read()[0]
@property
def pressure(self):
"""
The compensated pressure in hectoPascals.
returns None if pressure measurement is disabled
"""
self._read_temperature()
# Algorithm from the BMP280 driver
# https://github.com/BoschSensortec/BMP280_driver/blob/master/bmp280.c
adc = self._read24(_REGISTER_PRESSUREDATA) / 16 # lowest 4 bits get dropped
var1 = float(self._t_fine) / 2.0 - 64000.0
var2 = var1 * var1 * self._pressure_calib[5] / 32768.0
var2 = var2 + var1 * self._pressure_calib[4] * 2.0
var2 = var2 / 4.0 + self._pressure_calib[3] * 65536.0
var3 = self._pressure_calib[2] * var1 * var1 / 524288.0
var1 = (var3 + self._pressure_calib[1] * var1) / 524288.0
var1 = (1.0 + var1 / 32768.0) * self._pressure_calib[0]
if not var1:
return _BMP280_PRESSURE_MIN_HPA
pressure = 1048576.0 - adc
pressure = ((pressure - var2 / 4096.0) * 6250.0) / var1
var1 = self._pressure_calib[8] * pressure * pressure / 2147483648.0
var2 = pressure * self._pressure_calib[7] / 32768.0
pressure = pressure + (var1 + var2 + self._pressure_calib[6]) / 16.0
pressure /= 100
if pressure < _BMP280_PRESSURE_MIN_HPA:
return _BMP280_PRESSURE_MIN_HPA
if pressure > _BMP280_PRESSURE_MAX_HPA:
return _BMP280_PRESSURE_MAX_HPA
return pressure
"""The compensated pressure in hectoPascals."""
return self._read()[1]
@property
def altitude(self):
"""The altitude based on the sea level pressure (`sea_level_pressure`) - which you must
enter ahead of time)"""
p = self.pressure # in Si units for hPascal
p = self.pressure # in Si units for hPascal
return 44330 * (1.0 - math.pow(p / self.sea_level_pressure, 0.1903))
####################### Internal helpers ################################
def _read_coefficients(self):
"""Read & save the calibration coefficients"""
coeff = self._read_register(_REGISTER_DIG_T1, 24)
coeff = list(struct.unpack("<HhhHhhhhhhhh", bytes(coeff)))
coeff = list(struct.unpack('<HhhHhhhhhhhh', bytes(coeff)))
coeff = [float(i) for i in coeff]
# The temp_calib lines up with DIG_T# registers.
self._temp_calib = coeff[:3]
@ -395,14 +167,11 @@ class Adafruit_BMP280: # pylint: disable=invalid-name
"""Low level register writing, not implemented in base class"""
raise NotImplementedError()
class Adafruit_BMP280_I2C(Adafruit_BMP280): # pylint: disable=invalid-name
class Adafruit_BMP280_I2C(Adafruit_BMP280): # pylint: disable=invalid-name
"""Driver for I2C connected BMP280. Default address is 0x77 but another address can be passed
in as an argument"""
def __init__(self, i2c, address=0x77):
import adafruit_bus_device.i2c_device as i2c_device # pylint: disable=import-outside-toplevel
import adafruit_bus_device.i2c_device as i2c_device
self._i2c = i2c_device.I2CDevice(i2c, address)
super().__init__()
@ -412,23 +181,20 @@ class Adafruit_BMP280_I2C(Adafruit_BMP280): # pylint: disable=invalid-name
i2c.write(bytes([register & 0xFF]))
result = bytearray(length)
i2c.readinto(result)
# print("$%02X => %s" % (register, [hex(i) for i in result]))
#print("$%02X => %s" % (register, [hex(i) for i in result]))
return result
def _write_register_byte(self, register, value):
"""Low level register writing over I2C, writes one 8-bit value"""
with self._i2c as i2c:
i2c.write(bytes([register & 0xFF, value & 0xFF]))
# print("$%02X <= 0x%02X" % (register, value))
#print("$%02X <= 0x%02X" % (register, value))
class Adafruit_BMP280_SPI(Adafruit_BMP280):
"""Driver for SPI connected BMP280. Default clock rate is 100000 but can be changed with
'baudrate'"""
def __init__(self, spi, cs, baudrate=100000):
import adafruit_bus_device.spi_device as spi_device # pylint: disable=import-outside-toplevel
import adafruit_bus_device.spi_device as spi_device
self._spi = spi_device.SPIDevice(spi, cs, baudrate=baudrate)
super().__init__()
@ -440,7 +206,7 @@ class Adafruit_BMP280_SPI(Adafruit_BMP280):
spi.write(bytearray([register]))
result = bytearray(length)
spi.readinto(result)
# print("$%02X => %s" % (register, [hex(i) for i in result]))
#print("$%02X => %s" % (register, [hex(i) for i in result]))
return result
def _write_register_byte(self, register, value):

View file

@ -2,8 +2,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
@ -11,45 +10,34 @@ sys.path.insert(0, os.path.abspath(".."))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
]
intersphinx_mapping = {
"python": ("https://docs.python.org/3.4", None),
"BusDevice": (
"https://circuitpython.readthedocs.io/projects/busdevice/en/latest/",
None,
),
"Register": (
"https://circuitpython.readthedocs.io/projects/register/en/latest/",
None,
),
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
}
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
templates_path = ['_templates']
source_suffix = ".rst"
source_suffix = '.rst'
# The master toctree document.
master_doc = "index"
master_doc = 'index'
# General information about the project.
project = "Adafruit BMP280 Library"
copyright = "2017 ladyada"
author = "ladyada"
project = u'Adafruit BMP280 Library'
copyright = u'2017 ladyada'
author = u'ladyada'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "1.0"
version = u'1.0'
# The full version, including alpha/beta/rc tags.
release = "1.0"
release = u'1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -61,7 +49,7 @@ language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
# The reST default role (used for this markup: `text`) to use for all
# documents.
@ -73,7 +61,7 @@ default_role = "any"
add_function_parentheses = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
@ -82,67 +70,65 @@ todo_include_todos = False
todo_emit_warnings = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
except:
html_theme = "default"
html_theme_path = ["."]
html_theme = 'default'
html_theme_path = ['.']
else:
html_theme_path = ["."]
html_theme_path = ['.']
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_static_path = ['_static']
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
html_favicon = "_static/favicon.ico"
html_favicon = '_static/favicon.ico'
# Output file base name for HTML help builder.
htmlhelp_basename = "AdafruitBMP280Librarydoc"
htmlhelp_basename = 'AdafruitBMP280Librarydoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
"AdafruitBMP280Library.tex",
"Adafruit BMP280 Library Documentation",
author,
"manual",
),
(master_doc, 'AdafruitBMP280Library.tex', u'Adafruit BMP280 Library Documentation',
author, 'manual'),
]
# -- Options for manual page output ---------------------------------------
@ -150,13 +136,8 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(
master_doc,
"adafruitBMP280library",
"Adafruit BMP280 Library Documentation",
[author],
1,
)
(master_doc, 'adafruitBMP280library', u'Adafruit BMP280 Library Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
@ -165,16 +146,10 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
"AdafruitBMP280Library",
"Adafruit BMP280 Library Documentation",
author,
"AdafruitBMP280Library",
"One line description of project.",
"Miscellaneous",
),
(master_doc, 'AdafruitBMP280Library', u'Adafruit BMP280 Library Documentation',
author, 'AdafruitBMP280Library', 'One line description of project.',
'Miscellaneous'),
]
# API docs fix
autodoc_mock_imports = ["micropython"]
autodoc_mock_imports = ['micropython']

View file

@ -1,35 +0,0 @@
"""
Example showing how the BMP280 library can be used to set the various
parameters supported by the sensor.
Refer to the BMP280 datasheet to understand what these parameters do
"""
import time
import board
import busio
import adafruit_bmp280
# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
# OR create library object using our Bus SPI port
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# bmp_cs = digitalio.DigitalInOut(board.D10)
# bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)
# change this to match the location's pressure (hPa) at sea level
bmp280.sea_level_pressure = 1013.25
bmp280.mode = adafruit_bmp280.MODE_NORMAL
bmp280.standby_period = adafruit_bmp280.STANDBY_TC_500
bmp280.iir_filter = adafruit_bmp280.IIR_FILTER_X16
bmp280.overscan_pressure = adafruit_bmp280.OVERSCAN_X16
bmp280.overscan_temperature = adafruit_bmp280.OVERSCAN_X2
# The sensor will need a moment to gather inital readings
time.sleep(1)
while True:
print("\nTemperature: %0.1f C" % bmp280.temperature)
print("Pressure: %0.1f hPa" % bmp280.pressure)
print("Altitude = %0.2f meters" % bmp280.altitude)
time.sleep(2)

View file

@ -1,10 +1,9 @@
"""Simpletest Example that shows how to get temperature,
pressure, and altitude readings from a BMP280"""
import time
import board
import board
# import digitalio # For use with SPI
import busio
import adafruit_bmp280
# Create library object using our Bus I2C port
@ -12,9 +11,9 @@ i2c = busio.I2C(board.SCL, board.SDA)
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
# OR create library object using our Bus SPI port
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# bmp_cs = digitalio.DigitalInOut(board.D10)
# bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)
#spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
#bmp_cs = digitalio.DigitalInOut(board.D10)
#bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)
# change this to match the location's pressure (hPa) at sea level
bmp280.sea_level_pressure = 1013.25

View file

@ -7,7 +7,6 @@ https://github.com/pypa/sampleproject
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
@ -15,38 +14,47 @@ from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="adafruit-circuitpython-bmp280",
name='adafruit-circuitpython-bmp280',
use_scm_version=True,
setup_requires=["setuptools_scm"],
description="CircuitPython driver for the BMP280.",
setup_requires=['setuptools_scm'],
description='CircuitPython driver for the BMP280.',
long_description=long_description,
long_description_content_type="text/x-rst",
long_description_content_type='text/x-rst',
# The project's main homepage.
url="https://github.com/adafruit/Adafruit_CircuitPython_BMP280",
url='https://github.com/adafruit/Adafruit_CircuitPython_BMP280',
# Author details
author="Adafruit Industries",
author_email="circuitpython@adafruit.com",
install_requires=["Adafruit-Blinka", "adafruit-circuitpython-busdevice"],
author='Adafruit Industries',
author_email='circuitpython@adafruit.com',
install_requires=['Adafruit-Blinka', 'adafruit-circuitpython-busdevice'],
# Choose your license
license="MIT",
license='MIT',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Topic :: System :: Hardware",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Hardware',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
# What does your project relate to?
keywords="adafruit bmp280 barometric pressure temperature hardware sensor micropython circuitpython",
keywords='adafruit bmp280 barometric pressure temperature hardware sensor micropython circuitpython',
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
py_modules=["adafruit_bmp280"],
py_modules=['adafruit_bmp280'],
)