Metadata-Version: 2.1
Name: usbadc10
Version: 1.0.2
Summary: usbadc10 protocol python binding.
Author-email: EPC MSU <info@physlab.ru>
License: Copyright (c) 2024 EPC MSU
        
        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.
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Operating System :: Microsoft :: Windows :: Windows 11
Classifier: Operating System :: Microsoft :: Windows :: Windows 7
Classifier: Operating System :: Microsoft :: Windows :: Windows 8
Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown

## USBADC10

This is a python binding for usbadc10 cross-platform library for USBADC10 - a device that converts an input analog signal into a discrete code, includes 10 channels of a 12—bit ADC, an STM32 microcontroller and a USB interface that supplies power and reads digitized data.

![image](https://raw.githubusercontent.com/EPC-MSU/UALab/3982c42a179a38d2dce1af6235d4ec88ee8cab51/media/usbadc10_board.jpg)

### Installation

```
pip install usbadc10
```

### Minimal example

```python
from usbadc10 import Usbadc10DeviceHandle

# Set correct device URI here
# Format for Windows: com:\\.\COM5
# Format for Linux: /dev/ttyACM0
# Format for MacOS: com:///dev/tty.usbmodem000001234
device_uri = r'com:\\.\COM5'

# Create and open device instance
device = Usbadc10DeviceHandle(device_uri)

# Read raw data
raw_data_all_channels = list(device.get_conversion_raw().data)
print("List of raw ADC counts from all channels:\n", raw_data_all_channels)

# Read voltages in (10 * mV) units
voltage_all_channels = list(device.get_conversion().data)
print("List of voltages from all channels (in 10 * mV):\n", voltage_all_channels)

# Convert measurements to mV
voltage_all_channels_mV = [value/10 for value in voltage_all_channels]
print("List of voltages from all channels (in mV):\n", voltage_all_channels_mV)

# Close the device
device.close_device()
```

### More information

* usbadc10 website: https://usbadc10.physlab.ru/
