{ "info": { "author": "Martijn Braam", "author_email": "martijn@brixit.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "pyElectronics\n=============\n\n.. image:: https://travis-ci.org/MartijnBraam/pyElectronics.svg?branch=master\n :target: https://travis-ci.org/MartijnBraam/pyElectronics\n\n.. image:: https://badge.fury.io/py/pyelectronics.svg\n :target: https://badge.fury.io/py/pyelectronics\n\nThis is a python library for using electronics (like i2c or spi devices) with a unified interface. It currently supports\nconnecting to stuff through the Raspberry Pi gpio with the i2c kernel driver and using the Bus Pirate.\n\nSupported gateways\n------------------\n\nThe gateways are the bridge between Linux and the hardware. Currently supported:\n\n* Bus Pirate v3\n* Raspberry Pi / other linux i2c_dev supported interfaces\n\nSupported chips/devices\n-----------------------\n\n`Read the contributing guide`_ to add devices\n\n.. _Read the contributing guide: http://pythonhosted.org/pyelectronics/contributing.html\n\n* Bosch BMP180 Digital pressure sensor\n* Honeywell 3-Axis Digital Compass IC HMC5883L\n* MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS MotionTracking\u2122 Device\n* NXP LM75A Digital temperature sensor\n* Microchip MCP23017 16-Bit I/O Expander\n* 7-segment displays without multiplexing\n\nInstallation\n------------\n\nInstall it from pypi::\n\n $ pip3 install pyelectronics\n\nThe various gateways have their own dependencies. Install the dependencies for the gateway you require::\n\n # Requirements for the Raspberry Pi\n $ pip3 install pysmbus\n\n # Requirements for the Bus Pirate\n $ pip3 install pyserial\n\nTo run the doctests you need all dependencies. You can install them with the doctest requirements file::\n\n $ pip3 install -r docs/doctest-requirements.txt\n\nUsage\n-----\n\nRead the full docs at pythonhosted_.\n\n.. _pythonhosted: https://pythonhosted.org/pyelectronics/index.html\n\n\nFirst create a instance of a gateway::\n\n from electronics.gateways import BusPirate\n from electronics.gateways import LinuxDevice\n \n # Use a BusPirate to connect to a bus\n gw = BusPirate('/dev/ttyUSB0')\n \n # Use a i2c bus with a linux driver (like the raspberry pi)\n gw = LinuxDevice(1) # /dev/i2c-1\n\nCreate instances for components connected to the gateway::\n\n from electronics.devices import BMP180\n from electronics.devices import MPU6050I2C\n \n barometer = BMP180(gw, address=0x77) # Address is optional\n inertia = MPU6050(gw)\n \n # Do chip specific initialisation\n barometer.load_calibration()\n inertia.wakeup()\n\nRead values from sensors::\n\n temperature = barometer.temperature()\n pressure = barometer.pressure()\n acceleration = inertia.acceleration()\n rotation = inertia.angular_rate()\n\nExample with GPIO::\n\n # Red led conected to the aux pin of the bus pirate\n red_led = gw.get_aux_pin()\n # Turn the led on\n red_led.write(True)\n\n # An Microchip port expander connected through I2C\n expander = MCP23017I2C(gw, address=0x21)\n\n # Get the pins for the two other leds that are connected\n # to the port expander\n green_led = expander.get_pin('A0')\n blue_led = expander.get_pin('A1')\n\n # Bundle the leds to a bus so you can address 8 colours as an int\n # the pins on the port expander are open drain, they are inverted with the invert operator (~)\n bus = GPIOBus([red_led, ~green_led, ~blue_led])\n bus.write(0) # Black\n bus.write(7) # White\n\n # Disco!\n while True:\n for i in range(0,8):\n bus.write(i)\n sleep(0.2)", "description_content_type": null, "docs_url": "https://pythonhosted.org/pyelectronics/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MartijnBraam/pyElectronics", "keywords": "electronics,spi,i2c,buspirate", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyelectronics", "package_url": "https://pypi.org/project/pyelectronics/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyelectronics/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/MartijnBraam/pyElectronics" }, "release_url": "https://pypi.org/project/pyelectronics/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "Python 3 library for working with electronics", "version": "0.1.4" }, "last_serial": 1978733, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "aace3d309046879179ac280c9c8d981b", "sha256": "a4d36bc2c60d65665237e96c4d81ffa77ab4fe28c21fcff17c1fbf9416ece248" }, "downloads": -1, "filename": "pyelectronics-0.1.1.tar.gz", "has_sig": false, "md5_digest": "aace3d309046879179ac280c9c8d981b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8014, "upload_time": "2016-02-22T17:50:31", "url": "https://files.pythonhosted.org/packages/38/06/e40f7d8d80d21621c38e8ba022f6ea44ac447e1c7e95f3dfb6784aa36e03/pyelectronics-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "298db66a9fe066a0333d250ced050ff7", "sha256": "e5d9bda79f1773a325ddef7c9d026e2043951456d8844249c51f0f20831583fd" }, "downloads": -1, "filename": "pyelectronics-0.1.2.tar.gz", "has_sig": false, "md5_digest": "298db66a9fe066a0333d250ced050ff7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9834, "upload_time": "2016-02-23T11:40:50", "url": "https://files.pythonhosted.org/packages/07/7c/1b4d47902ca5bf487e2b8675f59c2c9a9e6ff97ea84d77de9f724e5a6e41/pyelectronics-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "35d9ed6bbf42c9051d19ee0d43e7417a", "sha256": "29e2e26c3d418e502a2b828cbed77e1e68681197bb752174839e31a7ccb4759a" }, "downloads": -1, "filename": "pyelectronics-0.1.3.tar.gz", "has_sig": false, "md5_digest": "35d9ed6bbf42c9051d19ee0d43e7417a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11162, "upload_time": "2016-02-24T14:36:47", "url": "https://files.pythonhosted.org/packages/33/93/50f57c74168af3a51ff3d57773478666e0806021492d1569dc4201bdf567/pyelectronics-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "40de074d29d8b4edb72707614adf7a41", "sha256": "9931399172462c753658b6d5cd7ea1cf40c9576cdb769f5e40b1614cf64ea0c1" }, "downloads": -1, "filename": "pyelectronics-0.1.4.tar.gz", "has_sig": false, "md5_digest": "40de074d29d8b4edb72707614adf7a41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13169, "upload_time": "2016-02-26T20:16:22", "url": "https://files.pythonhosted.org/packages/b8/3f/52003d90d83137dfb02bae6e58fa71f95fc49483ed85c93b62f48703f487/pyelectronics-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "40de074d29d8b4edb72707614adf7a41", "sha256": "9931399172462c753658b6d5cd7ea1cf40c9576cdb769f5e40b1614cf64ea0c1" }, "downloads": -1, "filename": "pyelectronics-0.1.4.tar.gz", "has_sig": false, "md5_digest": "40de074d29d8b4edb72707614adf7a41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13169, "upload_time": "2016-02-26T20:16:22", "url": "https://files.pythonhosted.org/packages/b8/3f/52003d90d83137dfb02bae6e58fa71f95fc49483ed85c93b62f48703f487/pyelectronics-0.1.4.tar.gz" } ] }