A Python library for DLN2 ADC adapters. Originally developed for Pico USB IO Board.
Project description
DLN2 ADC Wrapper
A Python library for interfacing with DLN2 USB-to-ADC adapters. This package targets the Pico USB I/O Board firmware in this repository and mirrors the packaging style of the other standalone DLN2 wrapper packages.
Features
- Low-level DLN2 USB ADC client built on
pyusb - High-level
ADChelper for enabling channels and reading raw samples - Raw 10-bit readings with optional voltage conversion
- Read-one and read-all channel helpers
- Command-line helpers for channel info and live watch output
- Pure Python, no compiled extension
Firmware Notes
The current firmware exposes three ADC channels:
- channel
0-> GP26 / ADC0 - channel
1-> GP27 / ADC1 - channel
2-> GP28 / ADC2
CHANNEL_GET_ALL_VAL returns space for eight values because it matches the DLN2
driver shape, but only the first three values are real on this firmware.
Installation
git clone https://github.com/syabyr/dln2_adc_wrapper.git
cd dln2_adc_wrapper
pip install .
For development:
pip install -e ".[dev]"
Quick Start
from dln2_adc_wrapper import ADC
with ADC() as adc:
print(adc.get_channel_count())
adc.enable_channel(0)
raw = adc.read_channel(0)
print(raw, adc.to_voltage(raw))
Command-Line Tools
dln2-adc-info --help
dln2-adc-watch --help
Development
make test
make build
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dln2_adc_wrapper-0.1.0.tar.gz.
File metadata
- Download URL: dln2_adc_wrapper-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a494b7dc505fdf396ffdc743fe36b61f56c39365153dee78bbb85abddf7460b
|
|
| MD5 |
c51b8b25e86a336f6f31e2e2b26a2294
|
|
| BLAKE2b-256 |
cb4ffa00d3f5443a47f85d132c97f344dbbef3d4ca99f374ebac28082cebf2b5
|
File details
Details for the file dln2_adc_wrapper-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dln2_adc_wrapper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7328b7ab30f6d0a640295c657e972037ad58ab56afc6309c0e70589cf7b1bb1
|
|
| MD5 |
1623b57c1b13855a77544cebd97fede8
|
|
| BLAKE2b-256 |
bbf56c73f46e21735c9b844aecafb6d243c8077521df977e0f0ae4b407d96cfc
|