Python interface with integrated software trigger for controlling USB oscilloscopes from Hantek.
Project description
Hantekosc provides a Python interface to control the mobile USB-oscilloscopes made by Hantek. It is based on library “Hantek6022API” (https://github.com/Ho-Ro/Hantek6022API).
Features
Implemented software trigger
Settings like recording length, sample rate, presample ratio or trigger mode can be set in a simple way
Examples
Example for initializing an oscilloscope device:
from hantekosc import oscilloscope osc = oscilloscope.Oscilloscope() osc.channels[0].voltage_range = 5 osc.channels[1].voltage_range = 5 osc.trigger_mode = 'REPEAT' osc.sample_rate = 1 * 1e6 osc.record_length = 2000 osc.pre_sample_ratio = 0.2 osc.selected_channel = 0 osc.channels[0].trigger_kind = 'FALLING' osc.channels[0].trigger_level = 0.5 osc.start()
Example of retrieving data from the oscilloscope’s channel 1 after initialization:
timing_data = osc.channels[0].measured_data[0] voltage_data = osc.channels[0].measured_data[1]
Installation requirements
Just copy the 60-hantek6022api rules to the system’s folder:
curl -fsSL https://raw.githubusercontent.com/BMecke/hantekosc/main/PyHT6022/udev/60-hantek6022api.rules | sudo tee /etc/udev/rules.d/60-hantek6022api.rules
Restart “udev” management tool:Restart “udev” management tool:
sudo service udev restart
Install hantekosc (The use of virtual environments is recommended):
pip install hantekosc
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 hantekosc-0.1.1.tar.gz.
File metadata
- Download URL: hantekosc-0.1.1.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c26ea2e08db38801b57352ab9747e4a3b2ca42f0ee877d5641790602b498be94
|
|
| MD5 |
f2418219fb29c0e2887a3c6d7d81b08a
|
|
| BLAKE2b-256 |
de8e0d5550f6d47977cbf68bcdf2f368bddbaef0b1869a56fd605256c77a68fd
|
File details
Details for the file hantekosc-0.1.1-py3-none-any.whl.
File metadata
- Download URL: hantekosc-0.1.1-py3-none-any.whl
- Upload date:
- Size: 209.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b676bc9b48c04b2c62a4359ed85951b668f1d45018d767b940c15df3be0635cf
|
|
| MD5 |
0bd3bde80118f056c8259ecd3439e711
|
|
| BLAKE2b-256 |
33ff25c6c456e737dac0e8be683e79a363b0c06e612a445638bf2017c3dbd797
|