Skip to main content

mightex_device_python

This Python package (mightex_device) creates a class named MightexDevice, which contains an instance of serial_device2.SerialDevice and adds methods to it to interface to Mightex LED controllers.

Authors:

Peter Polidoro <polidorop@janelia.hhmi.org>

License:

BSD

Example Usage:

from mightex_device import MightexDevice
dev = MightexDevice() # Might automatically find device if one available
# if it is not found automatically, specify port directly
dev = MightexDevice(port='/dev/ttyUSB0') # Linux
dev = MightexDevice(port='/dev/tty.usbmodem262471') # Mac OS X
dev = MightexDevice(port='COM3') # Windows
dev.get_serial_number()
'04-150824-007'
dev.get_channel_count()
4
channel = 0 # channel numbering starts at 0, not 1!
dev.get_mode(channel)
'disable'
dev.set_normal_parameters(channel,1000,30)
dev.get_normal_parameters(channel)
{'current': 30, 'current_max': 1000}
dev.set_mode_normal(channel)
dev.get_load_voltage(channel)
2622
dev.set_normal_current(channel,200)
dev.get_load_voltage(channel)
3054
dev.set_mode_disable(channel)
dev.set_strobe_parameters(channel,100,1)
dev.get_strobe_parameters(channel)
{'current_max': 100, 'repeat': 1}
dev.set_strobe_profile_set_point(channel,0,100,1000000)
dev.set_strobe_profile_set_point(channel,1,10,500000)
dev.set_strobe_profile_set_point(channel,2,0,0)
profile = dev.get_strobe_profile(channel)
profile
[{'current': 100, 'duration': 1000000},
 {'current': 10, 'duration': 500000},
 {'current': 0, 'duration': 0}]
dev.set_mode_strobe(channel)
dev.get_strobe_profile(channel+1)
[{'current': 20, 'duration': 1000},
 {'current': 10, 'duration': 1000},
 {'current': 0, 'duration': 0}]
dev.set_strobe_profile(channel+1,profile)
dev.get_strobe_profile(channel+1)
dev.set_mode_strobe(channel+1)
dev.set_trigger_parameters(channel,100,True)
dev.get_trigger_parameters(channel)
{'current_max': 100, 'falling_edge': True}
dev.set_trigger_profile_set_point(channel,0,100,1000000)
dev.set_trigger_profile_set_point(channel,1,10,500000)
dev.set_trigger_profile_set_point(channel,2,0,0)
dev.get_trigger_profile(channel)
[{'current': 100, 'duration': 1000000},
 {'current': 10, 'duration': 500000},
 {'current': 0, 'duration': 0}]
dev.set_mode_trigger(channel)
dev.reset()
dev.get_trigger_profile(channel)
[{'current': 20, 'duration': 1000},
 {'current': 10, 'duration': 1000},
 {'current': 0, 'duration': 0}]
dev.set_trigger_profile_set_point(channel,0,100,1000000)
dev.set_trigger_profile_set_point(channel,1,10,500000)
dev.set_trigger_profile_set_point(channel,2,0,0)
dev.store_parameters()
dev.reset()
dev.get_trigger_profile(channel)
[{'current': 100, 'duration': 1000000},
 {'current': 10, 'duration': 500000},
 {'current': 0, 'duration': 0}]
dev.restore_factory_defaults()
dev.store_parameters()
dev.reset()
dev.get_trigger_profile(channel)
[{'current': 10, 'duration': 20},
 {'current': 0, 'duration': 0}]
from mightex_device import MightexDevices
devs = MightexDevices()  # Might automatically find all available devices
# if they are not found automatically, specify ports to use
devs = MightexDevices(use_ports=['/dev/ttyUSB0','/dev/ttyUSB1']) # Linux
devs = MightexDevices(use_ports=['/dev/tty.usbmodem262471','/dev/tty.usbmodem262472']) # Mac OS X
devs = MightexDevices(use_ports=['COM3','COM4']) # Windows
devs.keys()
dev = devs[serial_number]

Metadata

Release files for mightex_device 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mightex_device 2.0.4
File Size Uploaded Provenance
mightex_device-2.0.4.tar.gz 10.1 kB Without provenance Details

Release files / mightex_device-2.0.4.tar.gz

Download URL mightex_device-2.0.4.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b3a8d19cb4c8c3179b33466895f3cb5097e4a5d63e35c22aea83bf04a5a02540
BLAKE2b-256 checksum
How to use checksums
38f004bf97046c2427719ae8856cc2e70e5055a05b08303127a59c284c3dc174
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for mightex_device 2.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page