adafruit-circuitpython-ov5640


Nameadafruit-circuitpython-ov5640 JSON
Version 1.1.16 PyPI version JSON
download
home_page
SummaryCircuitPython driver for OV5640 Camera
upload_time2024-02-26 17:44:20
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit ov5640 camera breakout hardware micropythoncircuitpython
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============


.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ov5640/badge/?version=latest
    :target: https://docs.circuitpython.org/projects/ov5640/en/latest/
    :alt: Documentation Status


.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
    :target: https://adafru.it/discord
    :alt: Discord


.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/workflows/Build%20CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/actions
    :alt: Build Status


.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
    :alt: Code Style: Black

CircuitPython driver for OV5640 Camera


Installing to a Connected CircuitPython Device with Circup
==========================================================

Make sure that you have ``circup`` installed in your Python environment.
Install it with the following command if necessary:

.. code-block:: shell

    pip3 install circup

With ``circup`` installed and your CircuitPython device connected use the
following command to install:

.. code-block:: shell

    circup install adafruit_ov5640

Or the following command to update an existing version:

.. code-block:: shell

    circup update

Usage Example
=============

.. code-block: python

    """Capture an image from the camera and display it as ASCII art.

    This demo is designed to run on the Kaluga, but you can adapt it
    to other boards by changing the constructors for `bus` and `cam`
    appropriately.

    The camera is placed in YUV mode, so the top 8 bits of each color
    value can be treated as "greyscale".

    It's important that you use a terminal program that can interpret
    "ANSI" escape sequences.  The demo uses them to "paint" each frame
    on top of the prevous one, rather than scrolling.

    Remember to take the lens cap off, or un-comment the line setting
    the test pattern!
    """

    import sys
    import time

    import busio
    import board

    import adafruit_ov5640

    print("construct bus")
    bus = busio.I2C(scl=board.CAMERA_SIOC, sda=board.CAMERA_SIOD)
    print("construct camera")
    cam = adafruit_ov5640.OV5640(
        bus,
        data_pins=board.CAMERA_DATA,
        clock=board.CAMERA_PCLK,
        vsync=board.CAMERA_VSYNC,
        href=board.CAMERA_HREF,
        mclk=board.CAMERA_XCLK,
        size=adafruit_ov5640.OV5640_SIZE_QQVGA,
    )
    print("print chip id")
    print(cam.chip_id)


    cam.colorspace = adafruit_ov5640.OV5640_COLOR_YUV
    cam.flip_y = True
    cam.flip_x = True
    cam.test_pattern = False

    buf = bytearray(cam.capture_buffer_size)
    chars = b" .':-+=*%$#"
    remap = [chars[i * (len(chars) - 1) // 255] for i in range(256)]

    width = cam.width
    row = bytearray(width)

    print("capturing")
    cam.capture(buf)
    print("capture complete")

    sys.stdout.write("\033[2J")
    while True:
        cam.capture(buf)
        for j in range(0, cam.height, 2):
            sys.stdout.write(f"\033[{j//2}H")
            for i in range(cam.width):
                row[i] = remap[buf[2 * (width * j + i)]]
            sys.stdout.write(row)
            sys.stdout.write("\033[K")
        sys.stdout.write("\033[J")
        time.sleep(0.05)

Documentation
=============

API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ov5640/en/latest/>`_.

For information on building library documentation, please check out
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_ov5640/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "adafruit-circuitpython-ov5640",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,ov5640,camera,breakout,hardware,micropythoncircuitpython",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/93/45/504b9baa29d2efc8e2cfee6f276ea4ddbc94032f4ceb5337a4c16331e63a/adafruit-circuitpython-ov5640-1.1.16.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ov5640/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/ov5640/en/latest/\n    :alt: Documentation Status\n\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_ov5640/actions\n    :alt: Build Status\n\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code Style: Black\n\nCircuitPython driver for OV5640 Camera\n\n\nInstalling to a Connected CircuitPython Device with Circup\n==========================================================\n\nMake sure that you have ``circup`` installed in your Python environment.\nInstall it with the following command if necessary:\n\n.. code-block:: shell\n\n    pip3 install circup\n\nWith ``circup`` installed and your CircuitPython device connected use the\nfollowing command to install:\n\n.. code-block:: shell\n\n    circup install adafruit_ov5640\n\nOr the following command to update an existing version:\n\n.. code-block:: shell\n\n    circup update\n\nUsage Example\n=============\n\n.. code-block: python\n\n    \"\"\"Capture an image from the camera and display it as ASCII art.\n\n    This demo is designed to run on the Kaluga, but you can adapt it\n    to other boards by changing the constructors for `bus` and `cam`\n    appropriately.\n\n    The camera is placed in YUV mode, so the top 8 bits of each color\n    value can be treated as \"greyscale\".\n\n    It's important that you use a terminal program that can interpret\n    \"ANSI\" escape sequences.  The demo uses them to \"paint\" each frame\n    on top of the prevous one, rather than scrolling.\n\n    Remember to take the lens cap off, or un-comment the line setting\n    the test pattern!\n    \"\"\"\n\n    import sys\n    import time\n\n    import busio\n    import board\n\n    import adafruit_ov5640\n\n    print(\"construct bus\")\n    bus = busio.I2C(scl=board.CAMERA_SIOC, sda=board.CAMERA_SIOD)\n    print(\"construct camera\")\n    cam = adafruit_ov5640.OV5640(\n        bus,\n        data_pins=board.CAMERA_DATA,\n        clock=board.CAMERA_PCLK,\n        vsync=board.CAMERA_VSYNC,\n        href=board.CAMERA_HREF,\n        mclk=board.CAMERA_XCLK,\n        size=adafruit_ov5640.OV5640_SIZE_QQVGA,\n    )\n    print(\"print chip id\")\n    print(cam.chip_id)\n\n\n    cam.colorspace = adafruit_ov5640.OV5640_COLOR_YUV\n    cam.flip_y = True\n    cam.flip_x = True\n    cam.test_pattern = False\n\n    buf = bytearray(cam.capture_buffer_size)\n    chars = b\" .':-+=*%$#\"\n    remap = [chars[i * (len(chars) - 1) // 255] for i in range(256)]\n\n    width = cam.width\n    row = bytearray(width)\n\n    print(\"capturing\")\n    cam.capture(buf)\n    print(\"capture complete\")\n\n    sys.stdout.write(\"\\033[2J\")\n    while True:\n        cam.capture(buf)\n        for j in range(0, cam.height, 2):\n            sys.stdout.write(f\"\\033[{j//2}H\")\n            for i in range(cam.width):\n                row[i] = remap[buf[2 * (width * j + i)]]\n            sys.stdout.write(row)\n            sys.stdout.write(\"\\033[K\")\n        sys.stdout.write(\"\\033[J\")\n        time.sleep(0.05)\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/ov5640/en/latest/>`_.\n\nFor information on building library documentation, please check out\n`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_ov5640/blob/HEAD/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CircuitPython driver for OV5640 Camera",
    "version": "1.1.16",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_OV5640"
    },
    "split_keywords": [
        "adafruit",
        "ov5640",
        "camera",
        "breakout",
        "hardware",
        "micropythoncircuitpython"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c56331de2c44f4ee5bc6bd2f0f5bcf4e69eff41ff0f501e1ca07c83803a6db64",
                "md5": "2b1f5eb5213c625c431ced3c138346d8",
                "sha256": "625319fe8abe8b050ff632ae7c9e69ff73650fe3e24a5086d98d55daa3304586"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_ov5640-1.1.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2b1f5eb5213c625c431ced3c138346d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 14019,
            "upload_time": "2024-02-26T17:44:19",
            "upload_time_iso_8601": "2024-02-26T17:44:19.085694Z",
            "url": "https://files.pythonhosted.org/packages/c5/63/31de2c44f4ee5bc6bd2f0f5bcf4e69eff41ff0f501e1ca07c83803a6db64/adafruit_circuitpython_ov5640-1.1.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9345504b9baa29d2efc8e2cfee6f276ea4ddbc94032f4ceb5337a4c16331e63a",
                "md5": "38fd91d228e6c0346779fa5020e3ab09",
                "sha256": "5890d1666263456801f3c93a2471094ba6df266f319b78f772f496aebe2be0ef"
            },
            "downloads": -1,
            "filename": "adafruit-circuitpython-ov5640-1.1.16.tar.gz",
            "has_sig": false,
            "md5_digest": "38fd91d228e6c0346779fa5020e3ab09",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 43260,
            "upload_time": "2024-02-26T17:44:20",
            "upload_time_iso_8601": "2024-02-26T17:44:20.790141Z",
            "url": "https://files.pythonhosted.org/packages/93/45/504b9baa29d2efc8e2cfee6f276ea4ddbc94032f4ceb5337a4c16331e63a/adafruit-circuitpython-ov5640-1.1.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-26 17:44:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adafruit",
    "github_project": "Adafruit_CircuitPython_OV5640",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "adafruit-circuitpython-ov5640"
}
        
Elapsed time: 0.19010s