Handyscope provides a Python interface to the mobile USB-oscilloscopes made by TiePie.
Project description
Handyscope provides a Python interface to the mobile USB-oscilloscopes made by TiePie.
This package is inspired by python-libtiepie and acts as an alternative. The main differences are the following:
python-libtiepie has some constants defined, which can be used to set properties like signal type. However, the user needs to know the names of these constants and they cannot be printed due to actually being numerical (binary) values. In handyscope, the values are given as strings and an overview of the available strings is provided in an additional property.
The error check is performed automatically after every method call.
More easier way of opening of devices.
Example of setting and getting the signal type in python-libtiepie:
# Set the signal type to triangle gen.signal_type = libtiepie.ST_TRIANGLE # Prints 0x00000010 print(gen.signal_type)
Example of setting and getting the signal type in handyscope:
# Prints the tuple ('sine', 'triangle', 'square', 'DC', 'noise', 'arbitrary', 'pulse') print(gen.signal_types_available) # Set the signal type to triangle gen.signal_type = "triangle" # Prints "triangle" print(gen.signal_type)
Example of opening a generator device from the python-libtiepie repository:
import libtiepie # Search for devices: libtiepie.device_list.update() # Try to open a generator: gen = None for item in libtiepie.device_list: if item.can_open(libtiepie.DEVICETYPE_GENERATOR): gen = item.open_generator() if gen: break
Example of opening a generator device using handyscope:
from handyscope import Generator gen = Generator("HS5")
Features
Uses libtiepie
Provides access to oscilloscope, signal generator and I2C interface features
Works with Windows and Linux
Installation
To install the Handyscope Interface, run this command in your terminal:
$ pip install handyscope
Note that usage in Windows will require the TiePie USB driver version 8.1.9
Usage
Example for using an oscilloscope device:
from handyscope import Oscilloscope # To initialize as HS3 oscilloscope device osc = Oscilloscope("HS3") # Set the range of the channels to 4 Volts osc.channels[0].range = 4 osc.channels[1].range = 4 # Set the trigger kind to rising edge osc.channels[0].trig_kind = "rising" # Enable the trigger osc.channels[0].trig_enabled= True # Disable the trigger timeout osc.trig_timeout = -1 # Set record length and sampling frequency osc.record_length = 62500 osc.sample_freq = 100000 # Start measuring and get the data data = osc.measure()
Example for using a generator device:
from handyscope import Generator # To initialize as HS3 generator device gen = Generator("HS3") # Set the signal type to a sinus wave gen.signal_type = "sine" # Set the amplitude to 2 Volts gen.amplitude = 2 # Set the frequency to 100 Hz gen.freq = 100 # Enable the output gen.is_out_on = True # Start the generator gen.start()
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 handyscope-1.1.0.tar.gz
.
File metadata
- Download URL: handyscope-1.1.0.tar.gz
- Upload date:
- Size: 4.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af0da547d4fc61de0dec57376dfb58272144e225f06c2c568ee6b6c1d1cd1d08 |
|
MD5 | cfc0010bb8639ffb53fc2fdc3988602c |
|
BLAKE2b-256 | 2db86e9354602847ba20881d6dc56c5b00e48a4b37e41954a5f1cf89edd33f98 |
File details
Details for the file handyscope-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: handyscope-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7c107d08a8059e12820e747e66f6c0cb02df085a58060099fe7c86c15ee73ba |
|
MD5 | 05adcb04a76da488d689b03203c881bc |
|
BLAKE2b-256 | ae6aabee316fb6c111a4a22eea755b7fcd700e5047d5bdb348d43048aa95165e |