Drivers for ADCs, sensors, and other electronic chips.
Project description
NuMat Chips
Python drivers for circuit board components. Intended for use with Raspberry Pis.
Why?
Many of the components supported here come with drivers. However, their code quality is mixed and many important chipset features can be missing or misconfigured. It's your chip and you should be able to use all of it.
These drivers were built ground up from the appropriate datasheets, making sure that all useful features are exposed or set to sensible defaults. The code is concise and linted, and this library works as a dependency.
Supported Chips
- ADS1115
- ADS8344
- MAX31855
- MAX31856
- MAX31865
- MCP3008
- MCP3202
- MCP3208
Installation
pip install numat-chips
Usage
For testing, you can call directly.
import chips
adc = chips.ADS1115(channel=0)
print(adc.read_voltage())
For production, consider subclassing to provide space to document the circuit and improve code reusability.
class PiraniGauge(MCP3202):
"""Reads from an Edwards APG100 vacuum pressure transmitter.
The gauge is a 0-10V signal, split into a 0-3.3V range by three 10-kiloohm
resistors.
"""
def get(self):
"""Returns the pressure reading, in torr."""
return 10 ** (3 * self.read_voltage() - 6.125)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file numat-chips-0.1.1.tar.gz
.
File metadata
- Download URL: numat-chips-0.1.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d8c6ea5e74d2ee09fbedf1562739088c5ff79825188cd9619bd6238195c4684 |
|
MD5 | 27f814b5ede73be4950f73ff75210d1f |
|
BLAKE2b-256 | e5cc902bd2476501617717eecf159f37cac091211d8dba65218575173e8ad191 |
File details
Details for the file numat_chips-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: numat_chips-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fecbdb0a0d7635ae42e8bb4f5f0b8e4c3172f923c335402938c1c610dc1e863 |
|
MD5 | 055b7f98a33b1a9fc449e241e1b1cffb |
|
BLAKE2b-256 | 1e70cdb50be20bd8db0cc712f5ae9a68b8dc8b1b9a4eb68921c60de00b25bc61 |