init - temp/pressure/humidity working
This commit is contained in:
commit
33d2992522
10 changed files with 551 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
__pycache__
|
||||
_build
|
||||
*.pyc
|
||||
53
.travis.yml
Normal file
53
.travis.yml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# Travis CI configuration for automated .mpy file generation.
|
||||
# Author: Tony DiCola
|
||||
# License: Public Domain
|
||||
# This configuration will work with Travis CI (travis-ci.org) to automacially
|
||||
# build .mpy files for CircuitPython when a new tagged release is created. This
|
||||
# file is relatively generic and can be shared across multiple repositories by
|
||||
# following these steps:
|
||||
# 1. Copy this file into a .travis.yml file in the root of the repository.
|
||||
# 2. Change the deploy > file section below to list each of the .mpy files
|
||||
# that should be generated. The config will automatically look for
|
||||
# .py files with the same name as the source for generating the .mpy files.
|
||||
# Note that the .mpy extension should be lower case!
|
||||
# 3. Commit the .travis.yml file and push it to GitHub.
|
||||
# 4. Go to travis-ci.org and find the repository (it needs to be setup to access
|
||||
# your github account, and your github account needs access to write to the
|
||||
# repo). Flip the 'ON' switch on for Travis and the repo, see the Travis
|
||||
# docs for more details: https://docs.travis-ci.com/user/getting-started/
|
||||
# 5. Get a GitHub 'personal access token' which has at least 'public_repo' or
|
||||
# 'repo' scope: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
|
||||
# Keep this token safe and secure! Anyone with the token will be able to
|
||||
# access and write to your GitHub repositories. Travis will use the token
|
||||
# to attach the .mpy files to the release.
|
||||
# 6. In the Travis CI settings for the repository that was enabled find the
|
||||
# environment variable editing page: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
|
||||
# Add an environment variable named GITHUB_TOKEN and set it to the value
|
||||
# of the GitHub personal access token above. Keep 'Display value in build
|
||||
# log' flipped off.
|
||||
# 7. That's it! Tag a release and Travis should go to work to add .mpy files
|
||||
# to the release. It takes about a 2-3 minutes for a worker to spin up,
|
||||
# build mpy-cross, and add the binaries to the release.
|
||||
language: generic
|
||||
|
||||
sudo: true
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key: $GITHUB_TOKEN
|
||||
file:
|
||||
- "adafruit_bme680.mpy"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
|
||||
before_install:
|
||||
- sudo apt-get -yqq update
|
||||
- sudo apt-get install -y build-essential git python python-pip
|
||||
- git clone https://github.com/adafruit/circuitpython.git
|
||||
- make -C circuitpython/mpy-cross
|
||||
- export PATH=$PATH:$PWD/circuitpython/mpy-cross/
|
||||
- sudo pip install shyaml
|
||||
|
||||
before_deploy:
|
||||
- shyaml get-values deploy.file < .travis.yml | sed 's/.mpy/.py/' | xargs -L1 mpy-cross
|
||||
74
CODE_OF_CONDUCT.md
Normal file
74
CODE_OF_CONDUCT.md
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
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 of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* 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 unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* 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 in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
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 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 contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
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 [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 ladyada for Adafruit Industries
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
44
README.rst
Normal file
44
README.rst
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
|
||||
Introduction
|
||||
============
|
||||
|
||||
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-bme680/badge/?version=latest
|
||||
:target: https://circuitpython.readthedocs.io/projects/bme680/en/latest/
|
||||
:alt: Documentation Status
|
||||
|
||||
.. image :: https://img.shields.io/discord/327254708534116352.svg
|
||||
:target: https://discord.gg/nBQh6qu
|
||||
:alt: Discord
|
||||
|
||||
TODO
|
||||
|
||||
Dependencies
|
||||
=============
|
||||
This driver depends on:
|
||||
|
||||
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
|
||||
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
|
||||
|
||||
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>`_.
|
||||
|
||||
Usage Example
|
||||
=============
|
||||
|
||||
TODO
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
||||
Contributions are welcome! Please read our `Code of Conduct
|
||||
<https://github.com/adafruit/Adafruit_CircuitPython_bme680/blob/master/CODE_OF_CONDUCT.md>`_
|
||||
before contributing to help this project stay welcoming.
|
||||
|
||||
API Reference
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
api
|
||||
206
adafruit_bme680.py
Normal file
206
adafruit_bme680.py
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
import time, math
|
||||
from micropython import const
|
||||
try:
|
||||
import struct
|
||||
except ImportError:
|
||||
import ustruct as struct
|
||||
|
||||
# I2C ADDRESS/BITS/SETTINGS
|
||||
# -----------------------------------------------------------------------
|
||||
_BME680_ADDRESS = const(0x77)
|
||||
_BME680_CHIPID = const(0x61)
|
||||
|
||||
_BME680_REG_CHIPID = const(0xD0)
|
||||
_BME680_BME680_COEFF_ADDR1 = const(0x89)
|
||||
_BME680_BME680_COEFF_ADDR2 = const(0xE1)
|
||||
_BME680_BME680_RES_WAIT_0 = const(0x5A)
|
||||
|
||||
_BME680_REG_SOFTRESET = const(0xE0)
|
||||
_BME680_REG_CTRL_GAS = const(0x71)
|
||||
_BME680_REG_CTRL_HUM = const(0x72)
|
||||
_BME280_REG_STATUS = const(0xF3)
|
||||
_BME680_REG_CTRL_MEAS = const(0x74)
|
||||
_BME680_REG_CONFIG = const(0x75)
|
||||
|
||||
_BME680_REG_STATUS = const(0x1D)
|
||||
_BME680_REG_PDATA = const(0x1F)
|
||||
_BME680_REG_TDATA = const(0x22)
|
||||
_BME680_REG_HDATA = const(0x25)
|
||||
|
||||
_BME280_PRESSURE_MIN_HPA = const(300)
|
||||
_BME280_PRESSURE_MAX_HPA = const(1100)
|
||||
_BME280_HUMIDITY_MIN = const(0)
|
||||
_BME280_HUMIDITY_MAX = const(100)
|
||||
_BME680_SAMPLERATES = (0, 1, 2, 4, 8, 16)
|
||||
|
||||
_BME680_RUNGAS = const(0x10)
|
||||
|
||||
class Adafruit_BME680:
|
||||
def __init__(self):
|
||||
"""Check the BME680 was found, read the coefficients and enable the sensor for continuous reads"""
|
||||
self._write(_BME680_REG_SOFTRESET, [0xB6])
|
||||
time.sleep(0.5)
|
||||
|
||||
# Check device ID.
|
||||
id = self._read_byte(_BME680_REG_CHIPID)
|
||||
if _BME680_CHIPID != id:
|
||||
raise RuntimeError('Failed to find BME680! Chip ID 0x%x' % id)
|
||||
|
||||
self._read_coefficients()
|
||||
|
||||
# set up heater
|
||||
self._write(_BME680_BME680_RES_WAIT_0, [0x73, 0x64, 0x65])
|
||||
self.seaLevelhPa = 1013.25
|
||||
#self.pressure_oversample = 16
|
||||
#self.temp_oversample = 2
|
||||
#self.hum_oversample = 1
|
||||
self.osrs_h = 2
|
||||
self.osrs_t = 4
|
||||
self.osrs_p = 3
|
||||
self.filter = 2
|
||||
|
||||
# set filter
|
||||
self._write(_BME680_REG_CONFIG, [self.filter << 2])
|
||||
# turn on temp oversample & pressure oversample
|
||||
self._write(_BME680_REG_CTRL_MEAS, [(self.osrs_t << 5)|(self.osrs_p << 2)])
|
||||
# turn on humidity oversample
|
||||
self._write(_BME680_REG_CTRL_HUM, [self.osrs_h])
|
||||
# gas measurements enabled
|
||||
self._write(_BME680_REG_CTRL_GAS, [_BME680_RUNGAS])
|
||||
|
||||
def reading(self):
|
||||
print("\n\nReading data");
|
||||
v = self._read(_BME680_REG_CTRL_MEAS, 1)[0]
|
||||
v = (v & 0xFC) | 0x01 # enable single shot!
|
||||
self._write(_BME680_REG_CTRL_MEAS, [v])
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
data = self._read(_BME680_REG_STATUS, 15)
|
||||
print([hex(i) for i in data])
|
||||
print("")
|
||||
self._status = data[0] & 0x80
|
||||
gas_idx = data[0] & 0x0F
|
||||
meas_idx = data[1]
|
||||
#print("status 0x%x gas_idx %d meas_idx %d" % (status, gas_idx, meas_idx))
|
||||
|
||||
self._adc_pres = self._read24(data[2:5]) / 16
|
||||
self._adc_temp = self._read24(data[5:8]) / 16
|
||||
self._adc_hum = struct.unpack('>H', bytes(data[8:10]))[0]
|
||||
self._adc_gas = int(struct.unpack('>H', bytes(data[13:15]))[0] / 64)
|
||||
#print(self._adc_hum)
|
||||
#print(self._adc_gas)
|
||||
self._status |= data[14] & 0x30 # VALID + STABILITY mask
|
||||
|
||||
@property
|
||||
def temperature(self):
|
||||
"""Gets the compensated temperature in degrees celsius."""
|
||||
self.reading()
|
||||
var1 = (self._adc_temp / 8) - (self._T1 * 2)
|
||||
var2 = (var1 * self._T2) / 2048
|
||||
var3 = ((var1 / 2) * (var1 / 2)) / 4096
|
||||
var3 = (var3 * self._T3 * 16) / 16384
|
||||
self.t_fine = int(var2 + var3)
|
||||
calc_temp = (((self.t_fine * 5) + 128) / 256)
|
||||
return calc_temp / 100
|
||||
|
||||
@property
|
||||
def pressure(self):
|
||||
self.temperature
|
||||
var1 = (self.t_fine / 2) - 64000
|
||||
var2 = ((var1 / 4) * (var1 / 4)) / 2048
|
||||
var2 = (var2 * self._P6) / 4
|
||||
var2 = var2 + (var1 * self._P5 * 2)
|
||||
var2 = (var2 / 4) + (self._P4 * 65536)
|
||||
var1 = ((var1 / 4) * (var1 / 4)) / 8192
|
||||
var1 = ((var1 * self._P3 * 32) / 8) + ((self._P2 * var1) / 2)
|
||||
var1 = var1 / 262144
|
||||
var1 = ((32768 + var1) * self._P1) / 32768
|
||||
calc_pres = 1048576 - self._adc_pres
|
||||
calc_pres = (calc_pres - (var2 / 4096)) * 3125
|
||||
calc_pres = (calc_pres / var1) * 2
|
||||
var1 = (self._P9 * (((calc_pres / 8) * (calc_pres / 8)) / 8192)) / 4096
|
||||
var2 = ((calc_pres / 4) * self._P8) / 8192
|
||||
var3 = ((calc_pres / 256) * (calc_pres / 256) * (calc_pres / 256) * self._P10) / 131072
|
||||
calc_pres += ((var1 + var2 + var3 + (self._P7 * 128)) / 16)
|
||||
return calc_pres/100
|
||||
|
||||
@property
|
||||
def humidity(self):
|
||||
self.temperature
|
||||
temp_scaled = ((self.t_fine * 5) + 128) / 256
|
||||
var1 = (self._adc_hum - (self._H1 * 16)) - ((temp_scaled * self._H3) / 200)
|
||||
var2 = (self._H2 * (((temp_scaled * self._H4) / 100) + (((temp_scaled * ((temp_scaled * self._H5) / 100)) / 64) / 100) + 16384)) / 1024
|
||||
var3 = var1 * var2
|
||||
var4 = self._H6 * 128
|
||||
var4 = (var4 + ((temp_scaled * self._H7) / 100)) / 16
|
||||
var5 = ((var3 / 16384) * (var3 / 16384)) / 1024
|
||||
var6 = (var4 * var5) / 2
|
||||
calc_hum = (((var3 + var6) / 1024) * 1000) / 4096
|
||||
print(calc_hum)
|
||||
calc_hum /= 1000 # get back to RH
|
||||
|
||||
if calc_hum > 100: calc_hum = 100
|
||||
if calc_hum < 0: calc_hum = 0
|
||||
return calc_hum
|
||||
|
||||
def _read24(self, arr):
|
||||
"""Read an unsigned 24-bit value as a floating point and return it."""
|
||||
ret = 0.0
|
||||
#print([hex(i) for i in arr])
|
||||
for b in arr:
|
||||
ret *= 256.0
|
||||
ret += float(b & 0xFF)
|
||||
return ret
|
||||
|
||||
def _read_coefficients(self):
|
||||
"""Read & save the calibration coefficients"""
|
||||
coeff = self._read(_BME680_BME680_COEFF_ADDR1, 25)
|
||||
coeff += self._read(_BME680_BME680_COEFF_ADDR2, 16)
|
||||
|
||||
coeff = list(struct.unpack('<hbBHhbBhhbbHhhBBBHbbbBbHhbb', bytes(coeff[1:])))
|
||||
#print("\n\n",coeff)
|
||||
coeff = [float(i) for i in coeff]
|
||||
self._T2,self._T3, skip, self._P1,self._P2,self._P3, skip, self._P4,self._P5,self._P7,self._P6, skip,self._P8,self._P9,self._P10, skip, h2m, self._H1,self._H3,self._H4,self._H5,self._H6,self._H7,self._T1,self._G2,self._G1,self._G3 = coeff
|
||||
|
||||
# flip around H1 & H2
|
||||
self._H2 = h2m * 16 + (self._H1 % 16)
|
||||
self._H1 /= 16
|
||||
|
||||
self._HEATRANGE = (self._read(0x02, 1)[0] & 0x30) / 16
|
||||
self._HEATVAL = self._read(0x00, 1)[0]
|
||||
self._SWERR = (self._read(0x04, 1)[0] & 0xF0) / 16
|
||||
|
||||
#print("T1-3: %d %d %d" % (self._T1, self._T2, self._T3))
|
||||
#print("P1-3: %d %d %d" % (self._P1, self._P2, self._P3))
|
||||
#print("P4-6: %d %d %d" % (self._P4, self._P5, self._P6))
|
||||
#print("P7-9: %d %d %d" % (self._P7, self._P8, self._P9))
|
||||
#print("P10: %d" % self._P10)
|
||||
#print("H1-3: %d %d %d" % (self._H1, self._H2, self._H3))
|
||||
#print("H4-7: %d %d %d %d" % (self._H4, self._H5, self._H6, self._H7))
|
||||
#print("G1-3: %d %d %d" % (self._G1, self._G2, self._G3))
|
||||
#print("HR %d HV %d SWERR %d" % (self._HEATRANGE, self._HEATVAL, self._SWERR))
|
||||
|
||||
def _read_byte(self, register):
|
||||
"""Read a byte register value and return it"""
|
||||
return self._read(register, 1)[0]
|
||||
|
||||
class Adafruit_BME680_I2C(Adafruit_BME680):
|
||||
def __init__(self, i2c, address=_BME680_ADDRESS):
|
||||
import adafruit_bus_device.i2c_device as i2c_device
|
||||
self._i2c = i2c_device.I2CDevice(i2c, address)
|
||||
super().__init__()
|
||||
|
||||
def _read(self, register, length):
|
||||
with self._i2c as i2c:
|
||||
i2c.write(bytes([register & 0xFF]))
|
||||
result = bytearray(length)
|
||||
i2c.read_into(result)
|
||||
print("$%02X => %s" % (register, [hex(i) for i in result]))
|
||||
return result
|
||||
|
||||
def _write(self, register, values):
|
||||
with self._i2c as i2c:
|
||||
values = [(v & 0xFF) for v in [register]+values]
|
||||
i2c.write(bytes(values))
|
||||
print("$%02X <= %s" % (values[0], [hex(i) for i in values[1:]]))
|
||||
5
api.rst
Normal file
5
api.rst
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
.. If you created a package, create one automodule per module in the package.
|
||||
|
||||
.. automodule:: adafruit_bme680
|
||||
:members:
|
||||
142
conf.py
Normal file
142
conf.py
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'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/bus_device/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']
|
||||
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'README'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Adafruit BME680 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 = u'1.0'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'1.0'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
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']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#
|
||||
default_role = "any"
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#
|
||||
add_function_parentheses = True
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
|
||||
# -- 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'
|
||||
|
||||
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(), '.']
|
||||
except:
|
||||
html_theme = 'default'
|
||||
html_theme_path = ['.']
|
||||
else:
|
||||
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']
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'AdafruitBME680Librarydoc'
|
||||
|
||||
# -- 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',
|
||||
}
|
||||
|
||||
# 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, 'AdafruitBME680Library.tex', u'Adafruit BME680 Library Documentation',
|
||||
author, 'manual'),
|
||||
]
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'adafruitBME680library', u'Adafruit BME680 Library Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'AdafruitBME680Library', u'Adafruit BME680 Library Documentation',
|
||||
author, 'AdafruitBME680Library', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
2
readthedocs.yml
Normal file
2
readthedocs.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
requirements_file: requirements.txt
|
||||
|
||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
adafruit-circuitpython-bus-device
|
||||
Loading…
Reference in a new issue