{ "info": { "author": "Adafruit Industries", "author_email": "circuitpython@adafruit.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries", "Topic :: System :: Hardware" ], "description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-apds9960/badge/?version=latest\n :target: https://circuitpython.readthedocs.io/projects/apds9960/en/latest/\n :alt: Documentation Status\n\n.. image :: https://img.shields.io/discord/327254708534116352.svg\n :target: https://discord.gg/nBQh6qu\n :alt: Discord\n\n.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_APDS9960.svg?branch=master\n :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_APDS9960\n :alt: Build Status\n\nThe APDS9960 is a specialize chip that detects hand gestures, proximity detection\nand ambient light color over I2C. Its available on\n`Adafruit as a breakout `_.\n\n\nInstallation and Dependencies\n=============================\nThis driver depends on:\n\n* `Adafruit CircuitPython `_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle `_.\n\nInstalling from PyPI\n--------------------\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from PyPI `_. To install for current user:\n\n.. code-block:: shell\n\n pip3 install adafruit-circuitpython-apds9960\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n sudo pip3 install adafruit-circuitpython-apds9960\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n mkdir project-name && cd project-name\n python3 -m venv .env\n source .env/bin/activate\n pip3 install adafruit-circuitpython-apds9960\n\nUsage Example\n=============\n\n.. code-block:: python\n\n import board\n import busio\n import digitalio\n from adafruit_apds9960.apds9960 import APDS9960\n\n i2c = busio.I2C(board.SCL, board.SDA)\n int_pin = digitalio.DigitalInOut(board.D5)\n apds = APDS9960(i2c, interrupt_pin=int_pin)\n\n apds.enable_proximity = True\n apds.proximity_interrupt_threshold = (0, 175)\n apds.enable_proximity_interrupt = True\n\n while True:\n print(apds.proximity())\n apds.clear_interrupt()\n\nHardware Set-up\n---------------\n\nConnect Vin to 3.3 V or 5 V power source, GND to ground, SCL and SDA to the appropriate pins.\n\nBasics\n------\n\nOf course, you must import i2c bus device, board pins, and the library:\n\n.. code:: python\n\n\n from board import SCL, SDA, A1\n from adafruit_apds9960.apds9960 import APDS9960\n import busio\n import digitalio\n\nTo set-up the device to gather data, initialize the I2CDevice using SCL\nand SDA pins. Then initialize the library. Optionally provide an interrupt\npin for proximity detection.\n\n.. code:: python\n\n int_pin = digitalio.DigitalInOut(A1)\n i2c = busio.I2C(SCL, SDA)\n apds = APDS9960(i2c, interrupt_pin=int_pin)\n\nGestures\n--------\n\nTo get a gesture, see if a gesture is available first, then get the gesture Code\n\n.. code:: python\n\n gesture = apds.gesture()\n if gesture == 1:\n print(\"up\")\n if gesture == 2:\n print(\"down\")\n if gesture == 3:\n print(\"left\")\n if gesture == 4:\n print(\"right\")\n\nColor Measurement\n-----------------\n\nTo get a color measure, enable color measures, wait for color data,\nthen get the color data.\n\n.. code:: python\n\n apds.enable_color = True\n\n while not apds.color_data_ready:\n time.sleep(0.005)\n\n r, g, b, c = apds.color_data\n print(\"r: {}, g: {}, b: {}, c: {}\".format(r, g, b, c))\n\nProximity Detection\n---------------------\n\nTo check for a object in proximity, see if a gesture is available first, then get the gesture Code\n\n.. code:: python\n\n apds.enable_proximity = True\n\n # set the interrupt threshold to fire when proximity reading goes above 175\n apds.proximity_interrupt_threshold = (0, 175)\n\n # enable the proximity interrupt\n apds.enable_proximity_interrupt = True\n\n while True:\n if not interrupt_pin.value:\n print(apds.proximity())\n\n # clear the interrupt\n apds.clear_interrupt()\n\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n`_\nbefore contributing to help this project stay welcoming.\n\nBuilding locally\n================\n\nTo build this library locally you'll need to install the\n`circuitpython-travis-build-tools `_ package.\n\n.. code-block::shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install -r requirements.txt\n\nOnce installed, make sure you are in the virtual environment:\n\n.. code-block::shell\n\n source .env/bin/activate\n\nThen run the build:\n\n.. code-block::shell\n\n circuitpython-build-bundles --filename_prefix adafruit-circuitpython-apds --library_location .\n\nSphinx documentation\n-----------------------\n\nSphinx is used to build the documentation based on rST files and comments in the code. First,\ninstall dependencies (feel free to reuse the virtual environment from above):\n\n.. code-block:: shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install Sphinx sphinx-rtd-theme\n\nNow, once you have the virtual environment activated:\n\n.. code-block:: shell\n\n cd docs\n sphinx-build -E -W -b html . _build/html\n\nThis will output the documentation to ``docs/_build/html``. Open the index.html in your browser to\nview them. It will also (due to -W) error out on any warning like Travis will. This is a good way to\nlocally verify it will pass.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/adafruit/Adafruit_CircuitPython_APDS9960", "keywords": "adafruit apsd9960 gesture color proximity light sensor hardware micropython circuitpython", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "adafruit-circuitpython-apds9960", "package_url": "https://pypi.org/project/adafruit-circuitpython-apds9960/", "platform": "", "project_url": "https://pypi.org/project/adafruit-circuitpython-apds9960/", "project_urls": { "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_APDS9960" }, "release_url": "https://pypi.org/project/adafruit-circuitpython-apds9960/1.2.5/", "requires_dist": null, "requires_python": "", "summary": "CircuitPython driver for APSD9960 Gesture breakout board", "version": "1.2.5" }, "last_serial": 5886536, "releases": { "1.1.1": [ { "comment_text": "", "digests": { "md5": "2aa56746f49b026f2708dcab02f3b13f", "sha256": "6ddaa2b9c7d17035260845dedd6344fc4550f57a1b69075da5a7bd8f40526409" }, "downloads": -1, "filename": "adafruit-circuitpython-apds9960-1.1.1.tar.gz", "has_sig": false, "md5_digest": "2aa56746f49b026f2708dcab02f3b13f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23368, "upload_time": "2018-07-03T23:21:17", "url": "https://files.pythonhosted.org/packages/9f/62/cdf4539f3aac451cdb415a0e1317630684e344bcfc60683f03c873288363/adafruit-circuitpython-apds9960-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "5adea4bb4a4194276dda0e8b93fa3c5f", "sha256": "b7747d61361a95293b288ee8d7350b1c39aa3819a630f253fc666210ae2d15e1" }, "downloads": -1, "filename": "adafruit-circuitpython-apds9960-1.1.2.tar.gz", "has_sig": false, "md5_digest": "5adea4bb4a4194276dda0e8b93fa3c5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23771, "upload_time": "2018-11-12T20:39:15", "url": "https://files.pythonhosted.org/packages/92/cc/4727cd335b6aae45819a0c211fbb21dc7fa57b2bf818685f5be32fdab60a/adafruit-circuitpython-apds9960-1.1.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "6b07416bf6db94ad73dc5507c93107ee", "sha256": "28114fb8da24b09aaaab123aca239288ae5c00d5aba2f811de04f741e5b7dcd8" }, "downloads": -1, "filename": "adafruit-circuitpython-apds9960-1.2.3.tar.gz", "has_sig": false, "md5_digest": "6b07416bf6db94ad73dc5507c93107ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23421, "upload_time": "2019-01-15T00:23:09", "url": "https://files.pythonhosted.org/packages/f8/a4/dc08de3710dc6249966ad2c706c49717f481d6c0ecc9b7a4099a5468de9f/adafruit-circuitpython-apds9960-1.2.3.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "c3e56f927ffa76d8bd9b3f3c9aee968e", "sha256": "d467ed4f008d0400a0b252cc27d350b04c195dc04f921117f48139b8352b0c03" }, "downloads": -1, "filename": "adafruit-circuitpython-apds9960-1.2.4.tar.gz", "has_sig": false, "md5_digest": "c3e56f927ffa76d8bd9b3f3c9aee968e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23433, "upload_time": "2019-08-23T12:10:28", "url": "https://files.pythonhosted.org/packages/48/9a/c54f59b296c28016be19485014fc384b402d7a945e94ef835c83fb628a86/adafruit-circuitpython-apds9960-1.2.4.tar.gz" } ], "1.2.5": [ { "comment_text": "", "digests": { "md5": "0e19c09882df912f1f5b68f682a37333", "sha256": "2ba94c26e054c330179f912c62b73f9b663e272886d7410d7f9ec2a2da313a69" }, "downloads": -1, "filename": "adafruit-circuitpython-apds9960-1.2.5.tar.gz", "has_sig": false, "md5_digest": "0e19c09882df912f1f5b68f682a37333", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23614, "upload_time": "2019-09-25T17:47:41", "url": "https://files.pythonhosted.org/packages/af/5b/93f906f5c0cb2334ea3951bc136299185451451cc297d852b84c6d82e543/adafruit-circuitpython-apds9960-1.2.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e19c09882df912f1f5b68f682a37333", "sha256": "2ba94c26e054c330179f912c62b73f9b663e272886d7410d7f9ec2a2da313a69" }, "downloads": -1, "filename": "adafruit-circuitpython-apds9960-1.2.5.tar.gz", "has_sig": false, "md5_digest": "0e19c09882df912f1f5b68f682a37333", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23614, "upload_time": "2019-09-25T17:47:41", "url": "https://files.pythonhosted.org/packages/af/5b/93f906f5c0cb2334ea3951bc136299185451451cc297d852b84c6d82e543/adafruit-circuitpython-apds9960-1.2.5.tar.gz" } ] }