{ "info": { "author": "Bernd Porr", "author_email": "mail@berndporr.me.uk", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Operating System :: POSIX", "Programming Language :: Python :: 3" ], "description": "==========================\nPython API for the USB-DUX\n==========================\n\nUSB-DUX are data acquisition boxes designed for Linux\n\nhttp://www.linux-usb-daq.co.uk\n\n* USB-DUX-D: 8 analogue inputs (isolated, 12 bit, 1 kHz), 4 analogue out (isolated, 12 bit) and 8 digital I/O\n* USB-DUX-sigma: 16 analogue inputs (isolated, 24 bit, 1 kHz), 4 analogue out (isolated, 8 bit) and 8 digital I/O\n\n\nInstallation instructions\n=========================\n\nMake sure that you have all `comedi` libraries,\n`swig` and `python3` installed (both runtime and development).\nUse your favourite package manager to install the packages.\n\nThen install `pyusbdux` by typing::\n \n pip3 install pyusbdux [--user] [--upgrade]\n\n\n\nQuick start guide\n=================\n\nHere are the basic steps how to use the API::\n\n # load the module\n import pyusbdux as dux\n\n # opens the 1st USBDUX device (autodetect)\n dux.open()\n\n # Start asynchronous data acquisition in the background: one channel, fs=250Hz\n dux.start(1,250)\n\n # Now we read data at our convenience in a loop or timer or thread\n # The following lines need to be repeated\n\n # Let's check if samples are available\n if (dux.hasSampleAvailable() == 0):\n \t # nope! Do something else or nothing\n\n # Let's get a sample (array of all USB-DUX channels)\n sample = dux.getSampleFromBuffer()\n\n # do something with the sample, for example print it\n print(sample)\n\n # rinse and repeat!\n # end of loop\n\n # shutdown\n dux.stop()\n dux.close()\n\n\nAPI documentation\n==================\n\nThese are the commands which allow you to access the analogue inputs asynchronously\nand the analogue outputs, digital input and outputs synchronously::\n\n # opens the comedi device with comediDeviceNumber\n open(comediDeviceNumber)\n open() # opens 1st USB-DUX device (autodetect)\n\n # Starts acquisition of n_channels at the sampling rate of fs.\n start(n_channels, fs)\n start(n_channels) # at fs=250\n\n # Checks if samples are available (=1) or zero if not.\n hasSampleAvailable();\n\n # Returns one sample from all channels.\n # returns always 16 values irrespective of how many channels\n # are measured. Blocking call if no samples are available.\n getSampleFromBuffer()\n\n # stops the background acquisition\n stop()\n\n # writes to a digital pin the value 0 or 1\n digital_out(channel, value)\n\n # reads from a digital pin\n digital_in(channel)\n\n # writes to an analogue output pin (raw ADC values)\n analoge_out(channel, value)\n\n # gets the max raw value of the analogue output\n get_analogue_out_max_raw_value()\n\n # closes the comedi device\n close()\n\n # returns the name of the board connected\n get_board_name()\n\nAny error in comedi throws an exception in python.\n\n\nExample / demo programs\n=======================\n\nIn the folder https://github.com/berndporr/pyusbdux/tree/master/examples are example\nscripts which show you how to sample data from the analogue and digital ports.\n\n\nTroubleshooting\n===============\n\nSpyder\n------\n\nStart your program from the terminal and never within Spyder. Here is\nan example::\n\n ~/pyusbdux$ cd examples\n ~/pyusbdux/examples$ python3 ./realtime_plot.py\n\nThe problem with Spyder is that it won't let your Python program terminate properly so\nthat you can examine variables etc. However, this means that\nthe USB-DUX board keeps running even if it seems that execution has finished.\nIf you then re-run your program\nit won't be able to talk to your USB-DUX.\n\nBottomline: Use Spyder only for editing, instead run your program from the terminal. Never start\nyour program from within Spyder.\n\n\nAfter an update still the old version is being used\n---------------------------------------------------\n\nIf you use the `--user` option to install / update packages Python might keep older versions.\n\nSolution: Do a `pip uninstall pyusbdux` multiple times until no version is left \non your computer. Then install it again as described above.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/berndporr/pyusbdux", "keywords": "", "license": "GPL v3", "maintainer": "", "maintainer_email": "", "name": "pyusbdux", "package_url": "https://pypi.org/project/pyusbdux/", "platform": "", "project_url": "https://pypi.org/project/pyusbdux/", "project_urls": { "Homepage": "https://github.com/berndporr/pyusbdux" }, "release_url": "https://pypi.org/project/pyusbdux/1.5.7/", "requires_dist": null, "requires_python": "", "summary": "API for the USB-DUX DAQ boxes for Linux (www.linux-usb-daq.co.uk)", "version": "1.5.7" }, "last_serial": 4600749, "releases": { "1.3.3": [ { "comment_text": "", "digests": { "md5": "956dfe090ed03ae0ad9792876fa9b2c9", "sha256": "8f5b3e981f2085ba461be286d8a5caae2649065e1f4c4ea66d8c2ac964057616" }, "downloads": -1, "filename": "pyusbdux-1.3.3.tar.gz", "has_sig": false, "md5_digest": "956dfe090ed03ae0ad9792876fa9b2c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6165, "upload_time": "2018-11-25T22:38:07", "url": "https://files.pythonhosted.org/packages/65/73/7e5c1540d491670125a258a2760fc8627f264b34366a9aab797111e611c3/pyusbdux-1.3.3.tar.gz" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "08ef92996901056cd96ec8bbcd8e3ab1", "sha256": "3f94f7cf046e5031c4216ec10710fbfe1a499f9d0da8594c3f5e0613d3875028" }, "downloads": -1, "filename": "pyusbdux-1.4.2.tar.gz", "has_sig": false, "md5_digest": "08ef92996901056cd96ec8bbcd8e3ab1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6114, "upload_time": "2018-11-30T11:37:35", "url": "https://files.pythonhosted.org/packages/3a/77/c0f49777882a8004f802a59f160df17b5521c9109b8c647f4ffba34bf044/pyusbdux-1.4.2.tar.gz" } ], "1.5.2": [ { "comment_text": "", "digests": { "md5": "b12b34b709a96e1c1b1c6a7155beb92b", "sha256": "84e40993242a0e520bed5889422a860d43cd774613dfcb093e137f406a91ff1f" }, "downloads": -1, "filename": "pyusbdux-1.5.2.tar.gz", "has_sig": false, "md5_digest": "b12b34b709a96e1c1b1c6a7155beb92b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5869, "upload_time": "2018-12-12T11:49:02", "url": "https://files.pythonhosted.org/packages/1a/1b/b74dd5f5295e410248a7a37996ba8cd5c87f74ee2f20ddce85ac9726f09b/pyusbdux-1.5.2.tar.gz" } ], "1.5.7": [ { "comment_text": "", "digests": { "md5": "c7c7bd7d04a1a5ce3e30b252f72261be", "sha256": "4956604f7ad4ccc24f0630cb227194b77adb42d558cda0cab55ec24b56cafcac" }, "downloads": -1, "filename": "pyusbdux-1.5.7-py3.6-linux-x86_64.egg", "has_sig": false, "md5_digest": "c7c7bd7d04a1a5ce3e30b252f72261be", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 74996, "upload_time": "2018-12-14T20:18:16", "url": "https://files.pythonhosted.org/packages/4f/1e/25f1aa0d44604a0bd504602be382fbe90742ca50ba70840ad1d77203b7c4/pyusbdux-1.5.7-py3.6-linux-x86_64.egg" }, { "comment_text": "", "digests": { "md5": "a47ce221fa70a6d329993adddd21f86c", "sha256": "ebbefab671b03cded25eb657c8729c5694938a08235902951d0ed876cf20e949" }, "downloads": -1, "filename": "pyusbdux-1.5.7.tar.gz", "has_sig": false, "md5_digest": "a47ce221fa70a6d329993adddd21f86c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6542, "upload_time": "2018-12-14T20:17:34", "url": "https://files.pythonhosted.org/packages/89/70/9d2d2d723528799fa74627fe1cf055b9ba62d4f664a4f5c6e3c53ecb942b/pyusbdux-1.5.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c7c7bd7d04a1a5ce3e30b252f72261be", "sha256": "4956604f7ad4ccc24f0630cb227194b77adb42d558cda0cab55ec24b56cafcac" }, "downloads": -1, "filename": "pyusbdux-1.5.7-py3.6-linux-x86_64.egg", "has_sig": false, "md5_digest": "c7c7bd7d04a1a5ce3e30b252f72261be", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 74996, "upload_time": "2018-12-14T20:18:16", "url": "https://files.pythonhosted.org/packages/4f/1e/25f1aa0d44604a0bd504602be382fbe90742ca50ba70840ad1d77203b7c4/pyusbdux-1.5.7-py3.6-linux-x86_64.egg" }, { "comment_text": "", "digests": { "md5": "a47ce221fa70a6d329993adddd21f86c", "sha256": "ebbefab671b03cded25eb657c8729c5694938a08235902951d0ed876cf20e949" }, "downloads": -1, "filename": "pyusbdux-1.5.7.tar.gz", "has_sig": false, "md5_digest": "a47ce221fa70a6d329993adddd21f86c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6542, "upload_time": "2018-12-14T20:17:34", "url": "https://files.pythonhosted.org/packages/89/70/9d2d2d723528799fa74627fe1cf055b9ba62d4f664a4f5c6e3c53ecb942b/pyusbdux-1.5.7.tar.gz" } ] }