{ "info": { "author": "Luiz Eduardo Nishino Gomes do Amaral", "author_email": "luizamaral306@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Hardware" ], "description": "RPi\\_mcp3008\n============\n\nRPi\\_mcp3008 is a library to listen to the MCP3008 A/D converter chip\nwith a RPi. This library implements the example communication protocol\ndescribed in the\n`datasheet `__.\n\nCommunication is made through RPi SPI port using\n`SpiDev `__\n\nWiring\n------\n\nConnect the SPI data cables in the tables bellow. Choose either CE0# or\nCE1# to connect to CS.\n\nRPi SPI GPIOs\n~~~~~~~~~~~~~\n\n+------------+--------+\n| RPi GPIO | Mode |\n+============+========+\n| GPIO 07 | CE1# |\n+------------+--------+\n| GPIO 08 | CE0# |\n+------------+--------+\n| GPIO 09 | MISO |\n+------------+--------+\n| GPIO 10 | MOSI |\n+------------+--------+\n| GPIO 11 | SCLK |\n+------------+--------+\n\nMCP3008 Pinout\n~~~~~~~~~~~~~~\n\n+-------+---------------+-------+--------------------------------------+\n| Pin | Description | Pin | Description |\n+=======+===============+=======+======================================+\n| 01 | CH0 | 09 | Vdd - Supply voltage (2.7V - 5.5V) |\n+-------+---------------+-------+--------------------------------------+\n| 02 | CH1 | 10 | Vref - Reference voltage |\n+-------+---------------+-------+--------------------------------------+\n| 03 | CH2 | 11 | AGND - Analog ground |\n+-------+---------------+-------+--------------------------------------+\n| 04 | CH3 | 12 | CLK - SPI Clock (SCLK) |\n+-------+---------------+-------+--------------------------------------+\n| 05 | CH4 | 13 | Dout - Data out (MISO) |\n+-------+---------------+-------+--------------------------------------+\n| 06 | CH5 | 14 | Din - Data in (MOSI) |\n+-------+---------------+-------+--------------------------------------+\n| 07 | CH6 | 15 | CS - Chip select (CE0# or CE1#) |\n+-------+---------------+-------+--------------------------------------+\n| 08 | CH7 | 16 | DGND - Digital ground |\n+-------+---------------+-------+--------------------------------------+\n\nPlease check the `Adafruit\nguide `__\non the MCP3008 for more information about wiring\n\nUsage\n-----\n\nRPi\\_mcp3008 uses the ``with`` statement to properly handle the SPI bus\ncleanup.\n\n.. code:: python\n\n import mcp3008\n with mcp3008.MCP3008() as adc:\n print adc.read([mcp3008.CH0]) # prints raw data [CH0]\n\nIt's possible instantiate the object normally, but it's necessary to\ncall the close method before terminating the program.\n\n.. code:: python\n\n import mcp3008\n adc = mcp3008.MCP3008()\n print adc.read([mcp3008.CH0]) # prints raw data [CH0]\n adc.close()\n\nThe initialization arguments are ``MCP3008(bus=0, device=0)`` where:\n``MCP3008(X, Y)`` will open ``/dev/spidev-X.Y``, same as\n``spidev.SpiDev.open(X, Y)`` Both arguments are optional and have a\ndefault value of ``0``\n\nMethods\n~~~~~~~\n\nCurrently there are two implemented methods:\n\n.. code:: python\n\n def read(self, modes, norm=False):\n '''\n Returns the raw value (0 ... 1024) of the reading.\n The modes argument is a list with the modes of operation to be read (e.g.\n [mcp3008.CH0,mcp3008.Df0]).\n norm is a normalization factor, usually Vref.\n '''\n\n.. code:: python\n\n def read_all(self, norm=False):\n '''\n Returns a list with the readings of all the modes\n Data Order:\n [DF0, DF1, DF2, DF3, DF4, DF5, DF6, DF7,\n CH0, CH1, CH2, CH3, CH4, CH5, CH6, CH7]\n norm is a normalization factor, usually Vref.\n '''\n\n- The ``modes`` argument must be a list with at least one of 16 modes\n listed `bellow <##%20MCP3008%20Operation%20Modes>`__\n- The ``norm`` argument is a normalization factor that rescales raw\n data, usually Vref\n\nFixed mode\n~~~~~~~~~~\n\nYou can also declare the class with a ``fixed mode``, which will make\nthe instance callable and always return the value of the listed modes.\nAgain you can normalize the data with the norm argument when calling the\ninstance.\n\n.. code:: python\n\n import mcp3008\n with mcp3008.MCP3008.fixed([mcp3008.CH0, mcp3008.DF0]) as adc:\n print adc() # prints raw data [CH0, DF0]\n print adc(5.2) # prints normalized data [CH0, DF0]\n\nMCP3008 Operation Modes\n-----------------------\n\nMCP3008 has 16 different operation modes: It can listen to each of the\nchannels individually **Single Ended** or in a pseudo-differential mode\n**Differential**\n\n+----------------+------------------------------+\n| Single Ended | Differential |\n+================+==============================+\n| CH0 | DF0 (CH0 = IN+; CH1 = IN-) |\n+----------------+------------------------------+\n| CH1 | DF0 (CH0 = IN-; CH1 = IN+) |\n+----------------+------------------------------+\n| CH2 | DF0 (CH2 = IN+; CH3 = IN-) |\n+----------------+------------------------------+\n| CH3 | DF0 (CH2 = IN-; CH3 = IN+) |\n+----------------+------------------------------+\n| CH4 | DF0 (CH4 = IN+; CH5 = IN-) |\n+----------------+------------------------------+\n| CH5 | DF0 (CH4 = IN-; CH5 = IN+) |\n+----------------+------------------------------+\n| CH6 | DF0 (CH6 = IN+; CH7 = IN-) |\n+----------------+------------------------------+\n| CH7 | DF0 (CH6 = IN-; CH7 = IN+) |\n+----------------+------------------------------+\n\nUse the table above as the operation mode when calling\n``MCP3008.read(modes)`` or setting the ``MCP3008.fixed(modes)`` mode.\n(e.g. ``MCP3008.read([mcp3008.CH0, mcp3008.DF1])``)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/luxedo/RPi_mcp3008", "keywords": "RPi MCP3008 SPI interface", "license": "GPL3", "maintainer": "", "maintainer_email": "", "name": "mcp3008", "package_url": "https://pypi.org/project/mcp3008/", "platform": "", "project_url": "https://pypi.org/project/mcp3008/", "project_urls": { "Homepage": "https://github.com/luxedo/RPi_mcp3008" }, "release_url": "https://pypi.org/project/mcp3008/0.1a3/", "requires_dist": [ "spidev" ], "requires_python": "", "summary": "RPi_mcp3008 is a library to listen to the MCP3008 A/D converter chip, as described in the datasheet.", "version": "0.1a3" }, "last_serial": 4733717, "releases": { "0.1.0a0": [ { "comment_text": "", "digests": { "md5": "85b1bad3cf87be38fb0b2bdebcd6903a", "sha256": "45f4ae86acd2d9fbf8328d1ac5f95c7c284b4d3fdee23c6b5aa694f5a9f5d6d4" }, "downloads": -1, "filename": "mcp3008-0.1.0a0.tar.gz", "has_sig": false, "md5_digest": "85b1bad3cf87be38fb0b2bdebcd6903a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3528, "upload_time": "2015-11-23T12:04:04", "url": "https://files.pythonhosted.org/packages/f8/af/a97340968896d6e3b71da26a303c5e2530961f8c02fba0e7714112f2f036/mcp3008-0.1.0a0.tar.gz" } ], "0.1a1": [ { "comment_text": "", "digests": { "md5": "c9381f9151f29a24cb7ceec1a271c233", "sha256": "8aabfdcd1a6a92dbe9d63d0d68936f25482293f4baf51330c9f97be96ff794a9" }, "downloads": -1, "filename": "mcp3008-0.1a1.tar.gz", "has_sig": false, "md5_digest": "c9381f9151f29a24cb7ceec1a271c233", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3523, "upload_time": "2015-12-13T15:09:35", "url": "https://files.pythonhosted.org/packages/20/b3/72dbd2493fa72a9f4fd8e633019582438ee06df394df3772968388f6dd4c/mcp3008-0.1a1.tar.gz" } ], "0.1a2": [ { "comment_text": "", "digests": { "md5": "ab2a6c83149b73eaa7b90b60ac1cd39a", "sha256": "e5aaaa1e0cc0b2caa677aa969f1061871a1f34f4c2ce8cb626cfa51bea1b456a" }, "downloads": -1, "filename": "mcp3008-0.1a2-py3-none-any.whl", "has_sig": false, "md5_digest": "ab2a6c83149b73eaa7b90b60ac1cd39a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15446, "upload_time": "2018-12-19T13:28:56", "url": "https://files.pythonhosted.org/packages/58/1e/b12bbe780cbf8b58c02c94389c6eff587285687657309257c15c959a37d9/mcp3008-0.1a2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f293edae3cc110c2bdd358c70d5074dd", "sha256": "8417015f7584e8b29428a8e8ed8ee2b6dcc93e047815cc69a5f06fe679e0e613" }, "downloads": -1, "filename": "mcp3008-0.1a2.tar.gz", "has_sig": false, "md5_digest": "f293edae3cc110c2bdd358c70d5074dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4806, "upload_time": "2015-12-13T18:33:02", "url": "https://files.pythonhosted.org/packages/aa/88/a9dc20f7ceb0b79e1cf8cb98b47c0b898162890adfb767a24dd2df66b9cb/mcp3008-0.1a2.tar.gz" } ], "0.1a3": [ { "comment_text": "", "digests": { "md5": "05d324cd9ab834248f62c7e26f607ffc", "sha256": "7635b751250294e0a73ebb851a547638ce7bd39ce3482af9ccb4b718da9b91bf" }, "downloads": -1, "filename": "mcp3008-0.1a3-py3-none-any.whl", "has_sig": false, "md5_digest": "05d324cd9ab834248f62c7e26f607ffc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15447, "upload_time": "2018-12-19T13:30:19", "url": "https://files.pythonhosted.org/packages/e8/d1/edcb23c7cebfdfbb38906aa0125c783dad161b790ebbba4ec1c797e27af5/mcp3008-0.1a3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1cca455e1c0fe80575dc61092d31098f", "sha256": "b01b41d86f7cbc014d42c4aca40d4b9959cdd55865f261d39e42ab1dc94254a1" }, "downloads": -1, "filename": "mcp3008-0.1a3.tar.gz", "has_sig": false, "md5_digest": "1cca455e1c0fe80575dc61092d31098f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3494, "upload_time": "2018-12-19T13:30:21", "url": "https://files.pythonhosted.org/packages/ef/b2/01a3d9a4a29f6ec05869ef9c26608812cb13f9dbd284681adb337ce2f61e/mcp3008-0.1a3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "05d324cd9ab834248f62c7e26f607ffc", "sha256": "7635b751250294e0a73ebb851a547638ce7bd39ce3482af9ccb4b718da9b91bf" }, "downloads": -1, "filename": "mcp3008-0.1a3-py3-none-any.whl", "has_sig": false, "md5_digest": "05d324cd9ab834248f62c7e26f607ffc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15447, "upload_time": "2018-12-19T13:30:19", "url": "https://files.pythonhosted.org/packages/e8/d1/edcb23c7cebfdfbb38906aa0125c783dad161b790ebbba4ec1c797e27af5/mcp3008-0.1a3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1cca455e1c0fe80575dc61092d31098f", "sha256": "b01b41d86f7cbc014d42c4aca40d4b9959cdd55865f261d39e42ab1dc94254a1" }, "downloads": -1, "filename": "mcp3008-0.1a3.tar.gz", "has_sig": false, "md5_digest": "1cca455e1c0fe80575dc61092d31098f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3494, "upload_time": "2018-12-19T13:30:21", "url": "https://files.pythonhosted.org/packages/ef/b2/01a3d9a4a29f6ec05869ef9c26608812cb13f9dbd284681adb337ce2f61e/mcp3008-0.1a3.tar.gz" } ] }