Python interface to Loadstar Sensors USB devices.
Project description
About
- Name: loadstar_sensors_interface
- Version: 0.5.0
- Description: Python interface to Loadstar Sensors USB devices.
- License: BSD 3-Clause License
- URL: https://github.com/janelia-pypi/loadstar_sensors_interface_python
- Author: Peter Polidoro
- Email: peter@polidoro.io
- Copyright: 2022 Howard Hughes Medical Institute
- Reference: https://www.loadstarsensors.com/
- Dependencies:
- serial_interface
- click
- plotext
Example Usage
from loadstar_sensors_interface import LoadstarSensorsInterface
dev = LoadstarSensorsInterface() # Try to automatically detect port
dev = LoadstarSensorsInterface(port='/dev/ttyUSB0') # Linux specific port
dev = LoadstarSensorsInterface(port='/dev/tty.usbmodem262471') # Mac OS X specific port
dev = LoadstarSensorsInterface(port='COM3') # Windows specific port
dev.tare()
sensor_value = dev.get_sensor_value()
model = dev.get_model()
device_id = dev.get_device_id()
units = dev.get_units()
load_capactiy = dev.get_load_capacity()
dev.set_averaging_window(10) # 1-1024 samples
dev.set_averaging_threshold(10) # 1-100 percent
dev.set_scale_factor(453.59) # e.g. lb to gram
scale_factor = dev.get_scale_factor()
settings = dev.get_settings()
Installation
https://github.com/janelia-pypi/python_setup
Linux
udev rules
# Recommended
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
# OR, manually download and copy this file to destination folder
sudo cp 99-platformio-udev.rules /etc/udev/rules.d/99-platformio-udev.rules
# Restart udev management tool
sudo service udev restart
# or
sudo udevadm control --reload-rules
sudo udevadm trigger
# Ubuntu/Debian users may need to add own “username” to the “dialout” group
sudo usermod -a -G dialout $USER
sudo usermod -a -G plugdev $USER
pip
python3 -m venv ~/venvs/loadstar_sensors_interface
source ~/venvs/loadstar_sensors_interface/bin/activate
pip install loadstar_sensors_interface
guix
Setup guix-janelia channel:
https://github.com/guix-janelia/guix-janelia
guix install python-loadstar-sensors-interface
Windows
drivers
Download and install Windows driver:
Loadstar Sensors Windows Driver
pip
python3 -m venv C:\venvs\loadstar_sensors_interface
C:\venvs\loadstar_sensors_interface\Scripts\activate
pip install loadstar_sensors_interface
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
Close
Hashes for loadstar_sensors_interface-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 890528bb6400ba1a0b4f4cd8c7fc52c292c11b3a6f9d3c792152b2710c64d5b0 |
|
MD5 | ebe1fc3ca18cc2d3beddfd071823ff9f |
|
BLAKE2b-256 | 61308ead5acebf7bcc01d55e1dd52ff7aef5c3e0e51f37a283e84b4ae5d88cd3 |
Close
Hashes for loadstar_sensors_interface-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da4cc1303c0d2faf4c1141ff3494bea36a845f2f8d9f71303be339ba908118e8 |
|
MD5 | c0f5a4215402a298f81ff25edab18607 |
|
BLAKE2b-256 | bda028331086a10c54f891049b13349d7c6b758a57c60cb971da074199670600 |